[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 11:22:04 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c75aef1ea4fa77f4b9277701d1b0ef06ecaf50af
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 20 19:18:02 2010 +0000
2010-07-20 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
HTML5 tree builder needs to call dispatchDocumentElementAvailable
https://bugs.webkit.org/show_bug.cgi?id=42654
This patch fixes the follout LayoutTests with --html5-treebuilder:
- userscripts/script-not-run-for-fragments.html
- userscripts/script-run-at-start.html
* html/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::HTMLConstructionSite):
(WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
(WebCore::HTMLConstructionSite::insertHTMLHtmlElement):
* html/HTMLConstructionSite.h:
* html/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 16beb7a..aea58bc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-07-20 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML5 tree builder needs to call dispatchDocumentElementAvailable
+ https://bugs.webkit.org/show_bug.cgi?id=42654
+
+ This patch fixes the follout LayoutTests with --html5-treebuilder:
+ - userscripts/script-not-run-for-fragments.html
+ - userscripts/script-run-at-start.html
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::HTMLConstructionSite):
+ (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlElement):
+ * html/HTMLConstructionSite.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+
2010-07-20 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
Reviewed by Steve Block.
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index fed794c..9d6cdd8 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -129,9 +129,10 @@ void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<N
child->attach();
}
-HTMLConstructionSite::HTMLConstructionSite(Document* document, FragmentScriptingPermission scriptingPermission)
+HTMLConstructionSite::HTMLConstructionSite(Document* document, FragmentScriptingPermission scriptingPermission, bool isParsingFragment)
: m_document(document)
, m_fragmentScriptingPermission(scriptingPermission)
+ , m_isParsingFragment(isParsingFragment)
, m_redirectAttachToFosterParent(false)
{
}
@@ -140,11 +141,18 @@ HTMLConstructionSite::~HTMLConstructionSite()
{
}
+void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded()
+{
+ if (m_document->frame() && !m_isParsingFragment)
+ m_document->frame()->loader()->dispatchDocumentElementAvailable();
+}
+
void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken& token)
{
RefPtr<Element> element = HTMLHtmlElement::create(m_document);
element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission);
m_openElements.pushHTMLHtmlElement(attach(m_document, element.release()));
+ dispatchDocumentElementAvailableIfNeeded();
}
void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomicHTMLToken& token, Element* element)
@@ -210,6 +218,7 @@ void HTMLConstructionSite::insertHTMLHtmlElement(AtomicHTMLToken& token)
{
ASSERT(!shouldFosterParent());
m_openElements.pushHTMLHtmlElement(attachToCurrent(createHTMLElement(token)));
+ dispatchDocumentElementAvailableIfNeeded();
}
void HTMLConstructionSite::insertHTMLHeadElement(AtomicHTMLToken& token)
diff --git a/WebCore/html/HTMLConstructionSite.h b/WebCore/html/HTMLConstructionSite.h
index e248af8..176433b 100644
--- a/WebCore/html/HTMLConstructionSite.h
+++ b/WebCore/html/HTMLConstructionSite.h
@@ -42,7 +42,7 @@ class Element;
class HTMLConstructionSite : public Noncopyable {
public:
- HTMLConstructionSite(Document*, FragmentScriptingPermission);
+ HTMLConstructionSite(Document*, FragmentScriptingPermission, bool isParsingFragment);
~HTMLConstructionSite();
void insertDoctype(AtomicHTMLToken&);
@@ -124,13 +124,16 @@ private:
PassRefPtr<Element> createElement(AtomicHTMLToken&, const AtomicString& namespaceURI);
void mergeAttributesFromTokenIntoElement(AtomicHTMLToken&, Element*);
+ void dispatchDocumentElementAvailableIfNeeded();
Document* m_document;
RefPtr<Element> m_head;
RefPtr<Element> m_form;
mutable HTMLElementStack m_openElements;
mutable HTMLFormattingElementList m_activeFormattingElements;
+
FragmentScriptingPermission m_fragmentScriptingPermission;
+ bool m_isParsingFragment;
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-intable
// In the "in table" insertion mode, we sometimes get into a state where
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 19e67df..3cdfa63 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -320,7 +320,7 @@ private:
HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors)
: m_framesetOk(true)
, m_document(document)
- , m_tree(document, FragmentScriptingAllowed)
+ , m_tree(document, FragmentScriptingAllowed, false)
, m_reportErrors(reportErrors)
, m_isPaused(false)
, m_insertionMode(InitialMode)
@@ -340,7 +340,7 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* documen
HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
: m_framesetOk(true)
, m_document(fragment->document())
- , m_tree(fragment->document(), scriptingPermission)
+ , m_tree(fragment->document(), scriptingPermission, true)
, m_reportErrors(false) // FIXME: Why not report errors in fragments?
, m_isPaused(false)
, m_insertionMode(InitialMode)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list