[Webkit-unassigned] [Bug 15960] New: View source mode displays the attributes after an attribute with an empty value incorrectly.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 12 15:35:06 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=15960

           Summary: View source mode displays the attributes after an
                    attribute with an empty value incorrectly.
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: anyang.ren at gmail.com


When in view source mode, the attributes of a tag after an attribute with an
empty value
are not displayed correctly.

For example, the HTML page at http://alioth.debian.org/ has this img tag:

<img src="/themes/gforge/images/logo.png" border="0" alt="" width="198"
height="52" />

Note that the alt attribute has an empty value.

In the view source mode, that img tag is displayed like this:
<img src="/themes/gforge/images/logo.png" border="0" alt="198" height="52" =""
/>

Note that the alt attribute and the attributes after it are incorrect.

The problem occurs in HTMLViewSourceDocument::addViewSourceToken:

                             Attribute* attr =
token->attrs->attributeItem(currAttr);
                            String name = attr->name().toString();
                            if (doctype)
                                addText(name, "webkit-html-doctype");
                            else {
                                m_current =
addSpanWithClassName("webkit-html-attribute-name");
                                addText(name, "webkit-html-attribute-name");
                                if (m_current != m_tbody)
                                    m_current =
static_cast<Element*>(m_current->parent());
                            }
                            if (attr->value().isNull() ||
attr->value().isEmpty())
                                currAttr++;                                   
<=== PROBLEM

The last statment, currAttr++, skips an empty attribute value, causing
attribute (name, value)
pairs to get out of sync.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list