Changeset 29427 in webkit


Ignore:
Timestamp:
Jan 11, 2008 9:50:36 PM (16 years ago)
Author:
mitz@apple.com
Message:

WebCore:

2008-01-11 Anyang Ren <anyang.ren@gmail.com>

Reviewed by Darin Adler.

http://bugs.webkit.org/show_bug.cgi?id=15960
The view source mode should skip an empty attribute value only if
the attribute name is not followed by an equal sign (=).

Test: fast/frames/viewsource-empty-attribute-value.html

  • html/HTMLViewSourceDocument.cpp: (WebCore::HTMLViewSourceDocument::addViewSourceToken):

LayoutTests:

2008-01-11 Anyang Ren <anyang.ren@gmail.com>

Reviewed by Darin Adler.

Add a new regression test for
http://bugs.webkit.org/show_bug.cgi?id=15960
The view source mode should skip an empty attribute value only if
the attribute name is not followed by an equal sign (=).

  • fast/frames/resources/viewsource-frame-1.html: Added.
  • fast/frames/viewsource-empty-attribute-value-expected.txt: Added.
  • fast/frames/viewsource-empty-attribute-value.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r29425 r29427  
     12008-01-11  Anyang Ren  <anyang.ren@gmail.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add a new regression test for
     6        http://bugs.webkit.org/show_bug.cgi?id=15960
     7        The view source mode should skip an empty attribute value only if
     8        the attribute name is not followed by an equal sign (=).
     9
     10        * fast/frames/resources/viewsource-frame-1.html: Added.
     11        * fast/frames/viewsource-empty-attribute-value-expected.txt: Added.
     12        * fast/frames/viewsource-empty-attribute-value.html: Added.
     13
    1142008-01-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
    215
  • trunk/WebCore/ChangeLog

    r29426 r29427  
     12008-01-11  Anyang Ren  <anyang.ren@gmail.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=15960
     6        The view source mode should skip an empty attribute value only if
     7        the attribute name is not followed by an equal sign (=).
     8
     9        Test: fast/frames/viewsource-empty-attribute-value.html
     10
     11        * html/HTMLViewSourceDocument.cpp:
     12        (WebCore::HTMLViewSourceDocument::addViewSourceToken):
     13
    1142008-01-11  Sylvain Pasche  <sylvain.pasche@gmail.com>
    215
  • trunk/WebCore/html/HTMLViewSourceDocument.cpp

    r21704 r29427  
    129129            unsigned begin = 0;
    130130            unsigned currAttr = 0;
     131            Attribute* attr = 0;
    131132            for (unsigned i = 0; i < size; i++) {
    132133                if (guide->at(i) == 'a' || guide->at(i) == 'x' || guide->at(i) == 'v') {
     
    136137                    begin = i + 1;
    137138
    138                     if (token->attrs && currAttr < token->attrs->length()) {
     139                    if (guide->at(i) == 'a') {
     140                        if (token->attrs && currAttr < token->attrs->length())
     141                            attr = token->attrs->attributeItem(currAttr++);
     142                        else
     143                            attr = 0;
     144                    }
     145                    if (attr) {
    139146                        if (guide->at(i) == 'a') {
    140                             Attribute* attr = token->attrs->attributeItem(currAttr);
    141147                            String name = attr->name().toString();
    142148                            if (doctype)
     
    148154                                    m_current = static_cast<Element*>(m_current->parent());
    149155                            }
    150                             if (attr->value().isNull() || attr->value().isEmpty())
    151                                 currAttr++;
    152156                        } else {
    153                             Attribute* attr = token->attrs->attributeItem(currAttr);
    154157                            String value = attr->value().domString();
    155158                            if (doctype)
     
    165168                                    m_current = static_cast<Element*>(m_current->parent());
    166169                            }
    167                             currAttr++;
    168170                        }
    169171                    }
Note: See TracChangeset for help on using the changeset viewer.