Changeset 87867 in webkit
- Timestamp:
- Jun 1, 2011 5:53:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87863 r87867 1 2011-06-01 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Reviewed by Simon Fraser. 4 5 CSSStyleSheet#insertRule doesn't work well with imported stylesheets 6 https://bugs.webkit.org/show_bug.cgi?id=56981 7 8 Test that a combination of insertRule and @import works properly. 9 10 * fast/css/import-and-insert-rule-no-update-expected.txt: Added. 11 * fast/css/import-and-insert-rule-no-update.html: Added. 12 * fast/css/resources/red.css: Added. 13 (div): 14 * fast/css/resources/redimport.css: Added. 15 1 16 2011-06-01 Abhishek Arya <inferno@chromium.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r87866 r87867 1 2011-06-01 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Reviewed by Simon Fraser. 4 5 CSSStyleSheet#insertRule doesn't work well with imported stylesheets 6 https://bugs.webkit.org/show_bug.cgi?id=56981 7 8 Test: fast/css/import-and-insert-rule-no-update.html 9 10 The bug arises from the fact that <link> element did not know about a programmatically 11 loading sheet (using insertRule and @import) and would thus never call removePendingSheet. 12 This is needed to make sure our style selector contains an up-to-date list of stylesheets. 13 14 The gist of the patch adds a way for style sheet owner element to know if we are 15 programmatically loading a style sheet. This is needed as <link> keeps the information 16 about that last loaded stylesheet. 17 18 * css/CSSImportRule.cpp: 19 (WebCore::CSSImportRule::insertedIntoParent): Call startLoadingDynamicSheet 20 on our parent style sheet instead of directly adding a pending style sheet. 21 22 * css/CSSStyleSheet.cpp: 23 (WebCore::CSSStyleSheet::startLoadingDynamicSheet): Call startLoadingDynamicSheet 24 on our owner element if we have one. 25 26 * css/CSSStyleSheet.h: 27 * dom/Node.h: 28 (WebCore::Node::startLoadingDynamicSheet): Added common implementation of 29 startLoadingDynamicSheet, which should never be called. 30 31 * dom/StyleElement.cpp: 32 (WebCore::StyleElement::startLoadingDynamicSheet): 33 * dom/StyleElement.h: 34 Common implementation of startLoadingDynamicSheet for style elements. 35 36 * html/HTMLLinkElement.cpp: 37 (WebCore::HTMLLinkElement::startLoadingDynamicSheet): 38 * html/HTMLLinkElement.h: 39 Use the HTMLLinkElement plumbing to make sure we call addRemovePendingSheet. 40 41 * html/HTMLStyleElement.h: 42 (WebCore::HTMLStyleElement::startLoadingDynamicSheet): 43 * svg/SVGStyleElement.h: 44 (WebCore::SVGStyleElement::startLoadingDynamicSheet): 45 Forward the call to StyleElement. 46 1 47 2011-06-01 Levi Weintraub <leviw@chromium.org> 2 48 -
trunk/Source/WebCore/css/CSSImportRule.cpp
r87239 r87867 145 145 // the sheet being imported is pending. 146 146 if (parentSheet && parentSheet->loadCompleted() && root == parentSheet) 147 parentSheet-> document()->addPendingSheet();147 parentSheet->startLoadingDynamicSheet(); 148 148 m_loading = true; 149 149 m_cachedSheet->addClient(this); -
trunk/Source/WebCore/css/CSSStyleSheet.cpp
r76728 r87867 231 231 } 232 232 233 void CSSStyleSheet::startLoadingDynamicSheet() 234 { 235 if (Node* owner = ownerNode()) 236 owner->startLoadingDynamicSheet(); 237 } 238 233 239 Document* CSSStyleSheet::document() 234 240 { -
trunk/Source/WebCore/css/CSSStyleSheet.h
r76728 r87867 87 87 88 88 virtual void checkLoaded(); 89 void startLoadingDynamicSheet(); 89 90 90 91 Document* document(); -
trunk/Source/WebCore/dom/Node.h
r87743 r87867 284 284 // For <link> and <style> elements. 285 285 virtual bool sheetLoaded() { return true; } 286 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); } 286 287 287 288 bool hasID() const { return getFlag(HasIDFlag); } -
trunk/Source/WebCore/dom/StyleElement.cpp
r85381 r87867 183 183 } 184 184 185 void StyleElement::startLoadingDynamicSheet(Document* document) 186 { 187 ASSERT(document); 188 document->addPendingSheet(); 185 189 } 190 191 } -
trunk/Source/WebCore/dom/StyleElement.h
r75352 r87867 42 42 bool isLoading() const; 43 43 bool sheetLoaded(Document*); 44 void startLoadingDynamicSheet(Document*); 44 45 45 46 void insertedIntoDocument(Document*, Element*); -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r87693 r87867 473 473 } 474 474 475 void HTMLLinkElement::startLoadingDynamicSheet() 476 { 477 // We don't support multiple blocking sheets. 478 ASSERT(m_pendingSheetType < Blocking); 479 addPendingSheet(Blocking); 480 } 481 475 482 bool HTMLLinkElement::isURLAttribute(Attribute *attr) const 476 483 { -
trunk/Source/WebCore/html/HTMLLinkElement.h
r87020 r87867 102 102 #endif 103 103 virtual bool sheetLoaded(); 104 virtual void startLoadingDynamicSheet(); 104 105 105 106 bool isAlternate() const { return m_disabledState == Unset && m_relAttribute.m_isAlternate; } -
trunk/Source/WebCore/html/HTMLStyleElement.h
r75352 r87867 56 56 virtual bool isLoading() const { return StyleElement::isLoading(); } 57 57 virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); } 58 virtual void startLoadingDynamicSheet() { StyleElement::startLoadingDynamicSheet(document()); } 58 59 59 60 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; -
trunk/Source/WebCore/svg/SVGStyleElement.h
r87010 r87867 60 60 virtual bool isLoading() const { return StyleElement::isLoading(); } 61 61 virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); } 62 virtual void startLoadingDynamicSheet() { StyleElement::startLoadingDynamicSheet(document()); } 62 63 }; 63 64
Note: See TracChangeset
for help on using the changeset viewer.