Changeset 45180 in webkit


Ignore:
Timestamp:
Jun 25, 2009 12:45:30 PM (15 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Darin Adler.

Test: fast/dom/style-sheet-candidate-remove-unrendered-document.html

When a "style sheet candidate" element is removed from a document,
call Document::removeStyleSheetCandidateNode() regardless of whether
the document is rendered. Otherwise, the document's style sheet
candidate set can end up containing stale references.

  • dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::removedFromDocument):
  • html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::removedFromDocument):
  • html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::removedFromDocument):

LayoutTests:

Reviewed by Darin Adler.

  • fast/dom/style-sheet-candidate-remove-unrendered-document-expected.txt: Added.
  • fast/dom/style-sheet-candidate-remove-unrendered-document.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r45178 r45180  
     12009-06-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - test for https://bugs.webkit.org/show_bug.cgi?id=26671
     6          <rdar://problem/7001880> Safari 4.0 crashes in
     7          WebCore::DOMTimer::fired()
     8
     9        * fast/dom/style-sheet-candidate-remove-unrendered-document-expected.txt: Added.
     10        * fast/dom/style-sheet-candidate-remove-unrendered-document.html: Added.
     11
    1122009-06-25  Eric Seidel  <eric@webkit.org>
    213
  • trunk/WebCore/ChangeLog

    r45179 r45180  
     12009-06-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=26671
     6          <rdar://problem/7001880> Safari 4.0 crashes in
     7          WebCore::DOMTimer::fired()
     8
     9        Test: fast/dom/style-sheet-candidate-remove-unrendered-document.html
     10
     11        When a "style sheet candidate" element is removed from a document,
     12        call Document::removeStyleSheetCandidateNode() regardless of whether
     13        the document is rendered. Otherwise, the document's style sheet
     14        candidate set can end up containing stale references.
     15
     16        * dom/ProcessingInstruction.cpp:
     17        (WebCore::ProcessingInstruction::removedFromDocument):
     18        * html/HTMLLinkElement.cpp:
     19        (WebCore::HTMLLinkElement::removedFromDocument):
     20        * html/HTMLStyleElement.cpp:
     21        (WebCore::HTMLStyleElement::removedFromDocument):
     22
    1232009-06-25  Dimitri Glazkov  <dglazkov@chromium.org>
    224
  • trunk/WebCore/dom/ProcessingInstruction.cpp

    r39441 r45180  
    259259    ContainerNode::removedFromDocument();
    260260
    261     if (document()->renderer())
    262         document()->removeStyleSheetCandidateNode(this);
     261    document()->removeStyleSheetCandidateNode(this);
    263262
    264263    // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
  • trunk/WebCore/html/HTMLLinkElement.cpp

    r44277 r45180  
    226226    HTMLElement::removedFromDocument();
    227227
     228    document()->removeStyleSheetCandidateNode(this);
     229
    228230    // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
    229     if (document()->renderer()) {
    230         document()->removeStyleSheetCandidateNode(this);
     231    if (document()->renderer())
    231232        document()->updateStyleSelector();
    232     }
    233233}
    234234
  • trunk/WebCore/html/HTMLStyleElement.cpp

    r43187 r45180  
    7272{
    7373    HTMLElement::removedFromDocument();
    74     if (document()->renderer())
    75         document()->removeStyleSheetCandidateNode(this);
     74    document()->removeStyleSheetCandidateNode(this);
    7675    StyleElement::removedFromDocument(document());
    7776}
Note: See TracChangeset for help on using the changeset viewer.