Changeset 117611 in webkit


Ignore:
Timestamp:
May 18, 2012 12:12:27 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Script elements inserted while fragment parsing should have their "already started" flag set.
https://bugs.webkit.org/show_bug.cgi?id=86376

Patch by Pablo Flouret <pablof@motorola.com> on 2012-05-18
Reviewed by Ryosuke Niwa.

Source/WebCore:

Step 3 of:
http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#scriptTag

Test: fast/parser/script-already-started-flag-in-fragment-parsing-mode.html

  • html/HTMLScriptElement.cpp:

(WebCore::HTMLScriptElement::create):

  • html/HTMLScriptElement.h:

(HTMLScriptElement):

  • html/parser/HTMLConstructionSite.cpp:

(WebCore::HTMLConstructionSite::insertScriptElement):

LayoutTests:

  • fast/parser/script-already-started-flag-in-fragment-parsing-mode-expected.txt: Added.
  • fast/parser/script-already-started-flag-in-fragment-parsing-mode.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117610 r117611  
     12012-05-18  Pablo Flouret  <pablof@motorola.com>
     2
     3        Script elements inserted while fragment parsing should have their "already started" flag set.
     4        https://bugs.webkit.org/show_bug.cgi?id=86376
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/parser/script-already-started-flag-in-fragment-parsing-mode-expected.txt: Added.
     9        * fast/parser/script-already-started-flag-in-fragment-parsing-mode.html: Added.
     10
    1112012-05-18  Shezan Baig  <shezbaig.wk@gmail.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r117610 r117611  
     12012-05-18  Pablo Flouret  <pablof@motorola.com>
     2
     3        Script elements inserted while fragment parsing should have their "already started" flag set.
     4        https://bugs.webkit.org/show_bug.cgi?id=86376
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Step 3 of:
     9        http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#scriptTag
     10
     11        Test: fast/parser/script-already-started-flag-in-fragment-parsing-mode.html
     12
     13        * html/HTMLScriptElement.cpp:
     14        (WebCore::HTMLScriptElement::create):
     15        * html/HTMLScriptElement.h:
     16        (HTMLScriptElement):
     17        * html/parser/HTMLConstructionSite.cpp:
     18        (WebCore::HTMLConstructionSite::insertScriptElement):
     19
    1202012-05-18  Shezan Baig  <shezbaig.wk@gmail.com>
    221
  • trunk/Source/WebCore/html/HTMLScriptElement.cpp

    r117195 r117611  
    4343}
    4444
    45 PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool wasInsertedByParser)
     45PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool wasInsertedByParser, bool alreadyStarted)
    4646{
    47     return adoptRef(new HTMLScriptElement(tagName, document, wasInsertedByParser, false));
     47    return adoptRef(new HTMLScriptElement(tagName, document, wasInsertedByParser, alreadyStarted));
    4848}
    4949
  • trunk/Source/WebCore/html/HTMLScriptElement.h

    r117195 r117611  
    3232class HTMLScriptElement : public HTMLElement, public ScriptElement {
    3333public:
    34     static PassRefPtr<HTMLScriptElement> create(const QualifiedName&, Document*, bool wasInsertedByParser);
     34    static PassRefPtr<HTMLScriptElement> create(const QualifiedName&, Document*, bool wasInsertedByParser, bool alreadyStarted = false);
    3535
    3636    String text() const { return scriptContent(); }
  • trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp

    r115645 r117611  
    336336void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken& token)
    337337{
    338     RefPtr<HTMLScriptElement> element = HTMLScriptElement::create(scriptTag, currentNode()->document(), true);
     338    RefPtr<HTMLScriptElement> element = HTMLScriptElement::create(scriptTag, currentNode()->document(), true, m_isParsingFragment);
    339339    if (m_fragmentScriptingPermission == FragmentScriptingAllowed)
    340340        element->parserSetAttributes(token.attributes(), m_fragmentScriptingPermission);
Note: See TracChangeset for help on using the changeset viewer.