Changeset 33492 in webkit


Ignore:
Timestamp:
May 15, 2008 12:49:42 PM (16 years ago)
Author:
jchaffraix@webkit.org
Message:

WebCore:

2008-05-15 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Darin.

https://bugs.webkit.org/show_bug.cgi?id=13942
ASSERTION FAILED: !attrName.contains('/') in HTMLTokenizer.cpp:132 when loading http://bamanzi.blogeden.cn/

In HTML, when an attribute was null (for example when we parse '="somevalue"'
(attribute forgotten or there is a space between the attribute and the '=')),
the fallback was to assign the value to the attribute. However if the value was
a url or did contain a '/', we would trigger the assertion.

To avoid that, we check the value before assigning it now and do not assign it
if it means adding a '/'.

Test: fast/parser/assertion-empty-attribute.html

  • html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::parseTag): Add check for '/' in value before assigning it to an attribute when the attribute is null.

LayoutTests:

2008-05-15 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Darin.

Test case for https://bugs.webkit.org/show_bug.cgi?id=13942
ASSERTION FAILED: !attrName.contains('/') in HTMLTokenizer.cpp:132 when loading http://bamanzi.blogeden.cn/

  • fast/parser/assertion-empty-attribute-expected.txt: Added.
  • fast/parser/assertion-empty-attribute.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r33491 r33492  
     12008-05-15  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        Test case for https://bugs.webkit.org/show_bug.cgi?id=13942
     6        ASSERTION FAILED: !attrName.contains('/') in HTMLTokenizer.cpp:132 when loading http://bamanzi.blogeden.cn/
     7
     8        * fast/parser/assertion-empty-attribute-expected.txt: Added.
     9        * fast/parser/assertion-empty-attribute.html: Added.
     10
    1112008-05-15  Alexey Proskuryakov  <ap@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r33488 r33492  
     12008-05-15  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=13942
     6        ASSERTION FAILED: !attrName.contains('/') in HTMLTokenizer.cpp:132 when loading http://bamanzi.blogeden.cn/
     7
     8        In HTML, when an attribute was null (for example when we parse '="somevalue"'
     9        (attribute forgotten or there is a space between the attribute and the '=')),
     10        the fallback was to assign the value to the attribute. However if the value was
     11        a url or did contain a '/', we would trigger the assertion.
     12
     13        To avoid that, we check the value before assigning it now and do not assign it
     14        if it means adding a '/'.
     15
     16        Test: fast/parser/assertion-empty-attribute.html
     17
     18        * html/HTMLTokenizer.cpp:
     19        (WebCore::HTMLTokenizer::parseTag): Add check for '/' in value before
     20        assigning it to an attribute when the attribute is null.
     21
    1222008-05-15  Kevin Ollivier  <kevino@theolliviers.com>
    223
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r31834 r33492  
    13561356                            dest--; // remove trailing newlines
    13571357                        AtomicString v(buffer + 1, dest - buffer - 1);
    1358                         attrName = v; // Just make the name/value match. (FIXME: Is this some WinIE quirk?)
     1358                        if (!v.contains('/'))
     1359                            attrName = v; // Just make the name/value match. (FIXME: Is this some WinIE quirk?)
    13591360                        currToken.addAttribute(m_doc, attrName, v, inViewSourceMode());
    13601361                        if (inViewSourceMode())
     
    13771378                            dest--; // remove trailing newlines
    13781379                        AtomicString v(buffer + 1, dest - buffer - 1);
    1379                         if (attrName.isEmpty()) {
     1380                        if (attrName.isEmpty() && !v.contains('/')) {
    13801381                            attrName = v; // Make the name match the value. (FIXME: Is this a WinIE quirk?)
    13811382                            if (inViewSourceMode())
Note: See TracChangeset for help on using the changeset viewer.