Changeset 74995 in webkit
- Timestamp:
- Jan 4, 2011 12:46:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r74993 r74995 1 2010-12-31 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Scripts should not be executed before preceding stylesheets are loaded 6 https://bugs.webkit.org/show_bug.cgi?id=8852 7 8 New tests plus a few test with slightly changed output due to different load serialization behavior. 9 10 * fast/tokenizer/inline-script-stylesheet-expected.txt: Added. 11 * fast/tokenizer/inline-script-stylesheet-write-expected.txt: Added. 12 * fast/tokenizer/inline-script-stylesheet-write.html: Added. 13 * fast/tokenizer/inline-script-stylesheet.html: Added. 14 * http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt: 15 * platform/mac/fast/repaint/renderer-destruction-by-invalidateSelection-crash-expected.txt: 16 1 17 2011-01-04 Csaba Osztrogonác <ossy@webkit.org> 2 18 -
trunk/LayoutTests/http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt
r48284 r74995 6 6 didDisplayInsecureContent 7 7 main frame - didFinishDocumentLoadForFrame 8 main frame - didHandleOnloadEventsForFrame 9 main frame - didFinishLoadForFrame 8 10 This test opens a window that loads an insecure style sheet. We should trigger a mixed content callback because the main frame in the window is HTTPS but is displaying insecure content. -
trunk/LayoutTests/platform/mac/fast/repaint/renderer-destruction-by-invalidateSelection-crash-expected.txt
r63403 r74995 12 12 RenderText {#text} at (0,0) size 0x0 13 13 RenderBlock {DIV} at (0,41) size 784x0 14 RenderBlock (anonymous) at (0,41) size 784x015 RenderText {#text} at (0,0) size 0x016 RenderText {#text} at (0,0) size 0x017 14 layer at (13,13) size 119x13 18 15 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/WebCore/ChangeLog
r74994 r74995 1 2010-12-31 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Scripts should not be executed before preceding stylesheets are loaded 6 https://bugs.webkit.org/show_bug.cgi?id=8852 7 8 Block inline script execution on pending stylesheet loads. This matches 9 other browsers and HTML5. 10 11 Tests: fast/tokenizer/inline-script-stylesheet-write.html 12 fast/tokenizer/inline-script-stylesheet.html 13 14 * dom/PendingScript.cpp: 15 (WebCore::PendingScript::releaseElementAndClear): 16 * dom/PendingScript.h: 17 (WebCore::PendingScript::PendingScript): 18 (WebCore::PendingScript::operator=): 19 (WebCore::PendingScript::startingPosition): 20 (WebCore::PendingScript::setStartingPosition): 21 * html/HTMLLinkElement.cpp: 22 (WebCore::HTMLLinkElement::process): 23 24 This fixes an unrelated bug with beforeload events that was exposed by the other 25 changes (fast/dom/beforeload/remove-link-in-beforeload-listener.html). 26 27 * html/parser/HTMLScriptRunner.cpp: 28 (WebCore::HTMLScriptRunner::sourceFromPendingScript): 29 (WebCore::HTMLScriptRunner::runScript): 30 1 31 2011-01-04 Xianzhu Wang <wangxianzhu@google.com> 2 32 -
trunk/WebCore/dom/PendingScript.cpp
r74724 r74995 42 42 setCachedScript(0); 43 43 m_watchingForLoad = false; 44 m_startingPosition = TextPosition1::belowRangePosition(); 44 45 return m_element.release(); 45 46 } -
trunk/WebCore/dom/PendingScript.h
r74724 r74995 46 46 PendingScript() 47 47 : m_watchingForLoad(false) 48 , m_startingPosition(TextPosition1::belowRangePosition()) 48 49 { 49 50 } … … 53 54 , m_watchingForLoad(other.m_watchingForLoad) 54 55 , m_element(other.m_element) 56 , m_startingPosition(other.m_startingPosition) 55 57 { 56 58 setCachedScript(other.cachedScript()); … … 66 68 m_watchingForLoad = other.m_watchingForLoad; 67 69 m_element = other.m_element; 70 m_startingPosition = other.m_startingPosition; 68 71 setCachedScript(other.cachedScript()); 69 72 70 73 return *this; 71 74 } 75 76 TextPosition1 startingPosition() const { return m_startingPosition; } 77 void setStartingPosition(const TextPosition1& position) { m_startingPosition = position; } 72 78 73 79 bool watchingForLoad() const { return m_watchingForLoad; } … … 86 92 bool m_watchingForLoad; 87 93 RefPtr<Element> m_element; 88 CachedResourceHandle<CachedScript> m_cachedScript; 94 TextPosition1 m_startingPosition; // Only used for inline script tags. 95 CachedResourceHandle<CachedScript> m_cachedScript; 89 96 }; 90 97 -
trunk/WebCore/html/HTMLLinkElement.cpp
r74476 r74995 238 238 } 239 239 240 RefPtr<Document> originalDocument = document(); 240 241 if (!dispatchBeforeLoadEvent(m_url)) 241 242 return; 242 243 // A beforeload handler might have removed us from the document or changed the document. 244 if (!inDocument() || document() != originalDocument) 245 return; 246 243 247 m_loading = true; 244 248 -
trunk/WebCore/html/parser/HTMLScriptRunner.cpp
r74724 r74995 100 100 } 101 101 errorOccurred = false; 102 return ScriptSourceCode(script.element()->textContent(), documentURLForScriptExecution(m_document) );102 return ScriptSourceCode(script.element()->textContent(), documentURLForScriptExecution(m_document), script.startingPosition()); 103 103 } 104 104 … … 304 304 else 305 305 requestParsingBlockingScript(script); 306 } else if (!m_document->haveStylesheetsLoaded() && m_scriptNestingLevel == 1) { 307 // Block inline script execution on stylesheet load, unless we are in document.write(). 308 // The latter case can only happen if a script both triggers a stylesheet load 309 // and writes an inline script. Since write is blocking we have to execute the 310 // written script immediately, ignoring the pending sheets. 311 m_parsingBlockingScript.adoptElement(script); 312 m_parsingBlockingScript.setStartingPosition(scriptStartPosition); 306 313 } else { 307 // FIXME: We do not block inline <script> tags on stylesheets to match the308 // old parser for now. When we do, the ASSERT below should be added.309 // See https://bugs.webkit.org/show_bug.cgi?id=40047310 // ASSERT(document()->haveStylesheetsLoaded());311 314 ASSERT(isExecutingScript()); 312 315 ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), scriptStartPosition);
Note: See TracChangeset
for help on using the changeset viewer.