~ubuntu-branches/ubuntu/oneiric/lynx-cur/oneiric-updates

« back to all changes in this revision

Viewing changes to src/HTML.c

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2009-06-07 21:50:20 UTC
  • mfrom: (1.20.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090607215020-w4i7y7azbrlskove
Tags: 2.8.7pre5-1
New Upstream Release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $LynxId: HTML.c,v 1.122 2009/05/25 19:53:35 tom Exp $
 
2
 * $LynxId: HTML.c,v 1.126 2009/05/29 00:24:15 tom Exp $
3
3
 *
4
4
 *              Structured stream to Rich hypertext converter
5
5
 *              ============================================
4316
4316
            I.value_cs = ATTR_CS_IN;
4317
4317
 
4318
4318
            UPDATE_STYLE;
4319
 
            if ((present && present[HTML_BUTTON_TYPE] &&
4320
 
                 value[HTML_BUTTON_TYPE]) &&
4321
 
                (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") ||
4322
 
                 !strcasecomp(value[HTML_BUTTON_TYPE], "reset"))) {
4323
 
                /*
4324
 
                 * It's a button for submitting or resetting a form.  - FM
4325
 
                 */
4326
 
                I.type = value[HTML_BUTTON_TYPE];
 
4319
            if (present &&
 
4320
                present[HTML_BUTTON_TYPE] &&
 
4321
                value[HTML_BUTTON_TYPE]) {
 
4322
                if (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") ||
 
4323
                    !strcasecomp(value[HTML_BUTTON_TYPE], "reset")) {
 
4324
                    /*
 
4325
                     * It's a button for submitting or resetting a form.  - FM
 
4326
                     */
 
4327
                    I.type = value[HTML_BUTTON_TYPE];
 
4328
                } else {
 
4329
                    /*
 
4330
                     * Ugh, it's a button for a script.  - FM
 
4331
                     */
 
4332
                    I.type = value[HTML_BUTTON_TYPE];
 
4333
                }
4327
4334
            } else {
4328
 
                /*
4329
 
                 * Ugh, it's a button for a script.  - FM
4330
 
                 */
4331
 
                HTML_put_string(me, " [BUTTON] ");
4332
 
                break;
4333
 
            }
4334
 
 
4335
 
            /*
4336
 
             * Make sure we're in a form.
4337
 
             */
4338
 
            if (!me->inFORM) {
4339
 
                if (LYBadHTML(me))
4340
 
                    CTRACE((tfp,
4341
 
                            "Bad HTML: BUTTON tag not within FORM tag\n"));
4342
 
                /*
4343
 
                 * We'll process it, since the chances of a crash are small,
4344
 
                 * and we probably do have a form started.  - FM
4345
 
                 *
4346
 
                 break;
4347
 
                 */
 
4335
                /* default, if no type given, is a submit button */
 
4336
                I.type = "submit";
4348
4337
            }
4349
4338
 
4350
4339
            /*
4391
4380
                 * trailing spaces.  - FM
4392
4381
                 */
4393
4382
                LYReduceBlanks(I.value);
 
4383
            } else if (!strcasecomp(I.type, "button")) {
 
4384
                if (!isEmpty(I.name)) {
 
4385
                    StrAllocCopy(I.value, I.name);
 
4386
                } else {
 
4387
                    StrAllocCopy(I.value, "BUTTON");
 
4388
                }
4394
4389
            }
4395
4390
 
4396
4391
            if (present && present[HTML_BUTTON_DISABLED])
4550
4545
                    /*
4551
4546
                     * Ugh, a button for a script.
4552
4547
                     */
4553
 
                    HTML_put_string(me, "[BUTTON] ");
4554
 
                    break;
 
4548
                    not_impl = "[BUTTON Input]";
4555
4549
                }
4556
4550
                if (not_impl != NULL) {
4557
4551
                    if (me->inUnderline == FALSE) {
4572
4566
                }
4573
4567
            }
4574
4568
 
4575
 
            /*
4576
 
             * Check if we're in a form.  - FM
4577
 
             */
4578
 
            if (!me->inFORM) {
4579
 
                if (LYBadHTML(me))
4580
 
                    CTRACE((tfp,
4581
 
                            "Bad HTML: INPUT tag not within FORM tag\n"));
4582
 
                /*
4583
 
                 * We'll process it, since the chances of a crash are small,
4584
 
                 * and we probably do have a form started.  - FM
4585
 
                 *
4586
 
                 break;
4587
 
                 */
4588
 
            }
4589
 
 
4590
4569
            CTRACE((tfp, "Ok, we're trying type=[%s]\n", NONNULL(I.type)));
4591
4570
 
4592
4571
            /*