Changeset 117756 in webkit
- Timestamp:
- May 21, 2012, 3:47:25 AM (14 years ago)
- Location:
- releases/WebKitGTK/webkit-1.8
- Files:
-
- 4 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt (added)
-
LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt (added)
-
LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link.html (added)
-
LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/StyleElement.cpp (modified) (3 diffs)
-
Source/WebCore/dom/StyleElement.h (modified) (1 diff)
-
Source/WebCore/html/HTMLLinkElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLLinkElement.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog
r117283 r117756 1 2012-04-11 Erik Arvidsson <arv@chromium.org> 2 3 StyleElement ownerNode is not cleared correctly 4 https://bugs.webkit.org/show_bug.cgi?id=83696 5 6 Reviewed by Antti Koivisto. 7 8 * fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt: Added. 9 * fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt: Added. 10 * fast/dom/StyleSheet/detached-sheet-owner-node-link.html: Added. 11 * fast/dom/StyleSheet/detached-sheet-owner-node.html: Added. 12 1 13 2012-04-03 Abhishek Arya <inferno@chromium.org> 2 14 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog
r117283 r117756 1 2012-04-11 Erik Arvidsson <arv@chromium.org> 2 3 StyleElement ownerNode is not cleared correctly 4 https://bugs.webkit.org/show_bug.cgi?id=83696 5 6 Reviewed by Antti Koivisto. 7 8 When the css text changes in such a way that we remove the sheet of a style element or a link[rel=stylesheet] 9 element we need to ensure that the ownerNode of the sheet is cleared. If we don't do this and there is a 10 wrapper for the sheet the sheet is kept alive but the ownerNode of the sheet may point to a deleted node. 11 12 Tests: fast/dom/StyleSheet/detached-sheet-owner-node-link.html 13 fast/dom/StyleSheet/detached-sheet-owner-node.html 14 15 * dom/StyleElement.cpp: 16 (WebCore::StyleElement::removedFromDocument): 17 (WebCore::StyleElement::clearSheet): 18 (WebCore): 19 (WebCore::StyleElement::createSheet): 20 * dom/StyleElement.h: 21 (StyleElement): 22 * html/HTMLLinkElement.cpp: 23 (WebCore::HTMLLinkElement::process): 24 (WebCore::HTMLLinkElement::clearSheet): 25 (WebCore): 26 * html/HTMLLinkElement.h: 27 (HTMLLinkElement): 28 1 29 2012-04-03 Abhishek Arya <inferno@chromium.org> 2 30 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/dom/StyleElement.cpp
r95223 r117756 75 75 document->removeStyleSheetCandidateNode(element); 76 76 77 if (m_sheet) { 78 ASSERT(m_sheet->ownerNode() == element); 79 m_sheet->clearOwnerNode(); 80 m_sheet = 0; 81 } 77 if (m_sheet) 78 clearSheet(); 82 79 83 80 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. … … 140 137 } 141 138 139 void StyleElement::clearSheet() 140 { 141 ASSERT(m_sheet); 142 m_sheet->clearOwnerNode(); 143 m_sheet = 0; 144 } 145 142 146 void StyleElement::createSheet(Element* e, int startLineNumber, const String& text) 143 147 { … … 148 152 if (m_sheet->isLoading()) 149 153 document->removePendingSheet(); 150 m_sheet = 0;154 clearSheet(); 151 155 } 152 156 -
releases/WebKitGTK/webkit-1.8/Source/WebCore/dom/StyleElement.h
r98106 r117756 55 55 void createSheet(Element*, int startLineNumber, const String& text = String()); 56 56 void process(Element*); 57 void clearSheet(); 57 58 58 59 bool m_createdByParser; -
releases/WebKitGTK/webkit-1.8/Source/WebCore/html/HTMLLinkElement.cpp
r114562 r117756 224 224 } else if (m_sheet) { 225 225 // we no longer contain a stylesheet, e.g. perhaps rel or type was changed 226 m_sheet = 0;226 clearSheet(); 227 227 document()->styleSelectorChanged(DeferRecalcStyle); 228 228 } 229 } 230 231 void HTMLLinkElement::clearSheet() 232 { 233 ASSERT(m_sheet); 234 ASSERT(m_sheet->ownerNode() == this); 235 m_sheet->clearOwnerNode(); 236 m_sheet = 0; 229 237 } 230 238 … … 252 260 document()->removeStyleSheetCandidateNode(this); 253 261 254 if (m_sheet) { 255 ASSERT(m_sheet->ownerNode() == this); 256 m_sheet->clearOwnerNode(); 257 m_sheet = 0; 258 } 262 if (m_sheet) 263 clearSheet(); 259 264 260 265 if (document()->renderer()) -
releases/WebKitGTK/webkit-1.8/Source/WebCore/html/HTMLLinkElement.h
r106769 r117756 67 67 void process(); 68 68 static void processCallback(Node*); 69 void clearSheet(); 69 70 70 71 virtual void insertedIntoDocument();
Note:
See TracChangeset
for help on using the changeset viewer.