Changeset 70094 in webkit


Ignore:
Timestamp:
Oct 19, 2010 3:16:12 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-19 James Simonsen <simonjam@chromium.org>

Reviewed by Adam Barth.

Add "in select" insertion mode to parser.

This was added to the spec in:
http://html5.org/tools/web-apps-tracker?from=5520&to=5522

And as a result of:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314

https://bugs.webkit.org/show_bug.cgi?id=47706

No new tests. Open to ideas.

  • html/parser/HTMLElementStack.cpp: Added "in select" mode. (WebCore::HTMLNames::isSelectScopeMarker): Ditto. (WebCore::HTMLElementStack::inSelectScope): Ditto.
  • html/parser/HTMLElementStack.h: Ditto.
  • html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTag): Use "in select" instead of "in table." (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r70093 r70094  
     12010-10-19  James Simonsen  <simonjam@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add "in select" insertion mode to parser.
     6
     7        This was added to the spec in:
     8        http://html5.org/tools/web-apps-tracker?from=5520&to=5522
     9
     10        And as a result of:
     11        http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314
     12
     13        https://bugs.webkit.org/show_bug.cgi?id=47706
     14
     15        No new tests. Open to ideas.
     16
     17        * html/parser/HTMLElementStack.cpp: Added "in select" mode.
     18        (WebCore::HTMLNames::isSelectScopeMarker): Ditto.
     19        (WebCore::HTMLElementStack::inSelectScope): Ditto.
     20        * html/parser/HTMLElementStack.h: Ditto.
     21        * html/parser/HTMLTreeBuilder.cpp:
     22        (WebCore::HTMLTreeBuilder::processStartTag): Use "in select" instead of "in table."
     23        (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
     24
    1252010-10-19  Jeremy Orlow  <jorlow@chromium.org>
    226
  • trunk/WebCore/html/parser/HTMLElementStack.cpp

    r67373 r70094  
    114114}
    115115
     116inline bool isSelectScopeMarker(Element* element)
     117{
     118    return !element->hasTagName(optgroupTag)
     119        && !element->hasTagName(optionTag);
     120}
     121
    116122}
    117123
     
    485491    // FIXME: Is localName() right for non-html elements?
    486492    return inButtonScope(tagName.localName());
     493}
     494
     495bool HTMLElementStack::inSelectScope(const AtomicString& targetTag) const
     496{
     497    return inScopeCommon<isSelectScopeMarker>(m_top.get(), targetTag);
     498}
     499
     500bool HTMLElementStack::inSelectScope(const QualifiedName& tagName) const
     501{
     502    // FIXME: Is localName() right for non-html elements?
     503    return inSelectScope(tagName.localName());
    487504}
    488505
  • trunk/WebCore/html/parser/HTMLElementStack.h

    r67372 r70094  
    118118    bool inButtonScope(const AtomicString& tagName) const;
    119119    bool inButtonScope(const QualifiedName&) const;
     120    bool inSelectScope(const AtomicString& tagName) const;
     121    bool inSelectScope(const QualifiedName&) const;
    120122
    121123    bool hasOnlyHTMLElementsInScope() const;
  • trunk/WebCore/html/parser/HTMLTreeBuilder.cpp

    r69170 r70094  
    14231423            || token.name() == textareaTag) {
    14241424            parseError(token);
    1425             if (!m_tree.openElements()->inTableScope(selectTag)) {
     1425            if (!m_tree.openElements()->inSelectScope(selectTag)) {
    14261426                ASSERT(isParsingFragment());
    14271427                return;
     
    22802280        }
    22812281        if (token.name() == selectTag) {
    2282             if (!m_tree.openElements()->inTableScope(token.name())) {
     2282            if (!m_tree.openElements()->inSelectScope(token.name())) {
    22832283                ASSERT(isParsingFragment());
    22842284                parseError(token);
Note: See TracChangeset for help on using the changeset viewer.