Commit 77989d8f authored by jschuh@chromium.org's avatar jschuh@chromium.org

2010-12-30 Justin Schuh <jschuh@chromium.org>

        Reviewed by James Robinson.

        Reverting r74292 because it introduced a crash with ruby text.
        https://bugs.webkit.org/show_bug.cgi?id=51637

        Test: fast/css/counters/counter-ruby-text-cleared.html

        * rendering/RenderCounter.cpp:
        (WebCore::findPlaceForCounter):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::addChild):
        * rendering/RenderObjectChildList.cpp:
        (WebCore::RenderObjectChildList::appendChildNode):
        (WebCore::RenderObjectChildList::insertChildNode):
2010-12-30  Justin Schuh  <jschuh@chromium.org>

        Reviewed by James Robinson.

        Check for crash when deleting ruby text with counters.
        https://bugs.webkit.org/show_bug.cgi?id=51637

        * fast/css/counters/counter-ruby-text-cleared-expected.txt: Added.
        * fast/css/counters/counter-ruby-text-cleared.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9d0882ec
2010-12-30 Justin Schuh <jschuh@chromium.org>
Reviewed by James Robinson.
Check for crash when deleting ruby text with counters.
https://bugs.webkit.org/show_bug.cgi?id=51637
* fast/css/counters/counter-ruby-text-cleared-expected.txt: Added.
* fast/css/counters/counter-ruby-text-cleared.html: Added.
2010-12-30 Mihai Parparita <mihaip@chromium.org>
Unreviewed Chromium baseline update.
......
PASS: Clearing ruby text with counters does not crash.
<style>* {counter-increment: x;}</style>
<script>
window.onload = function() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
document.body.innerHTML = "PASS: Clearing ruby text with counters does not crash.";
}
</script>
<ruby>
<rt></rt>
<div></div>
</ruby>
2010-12-30 Justin Schuh <jschuh@chromium.org>
Reviewed by James Robinson.
Reverting r74292 because it introduced a crash with ruby text.
https://bugs.webkit.org/show_bug.cgi?id=51637
Test: fast/css/counters/counter-ruby-text-cleared.html
* rendering/RenderCounter.cpp:
(WebCore::findPlaceForCounter):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addChild):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::appendChildNode):
(WebCore::RenderObjectChildList::insertChildNode):
2010-12-30 Darin Adler <darin@apple.com>
Reviewed by David Kilzer.
......
......@@ -136,6 +136,11 @@ static bool findPlaceForCounter(RenderObject* counterOwner, const AtomicString&
RenderObject* currentRenderer = counterOwner->previousInPreOrder();
previousSibling = 0;
while (currentRenderer) {
// A sibling without a parent means that the counter node tree was not constructed correctly so we stop
// traversing. In the future RenderCounter should handle RenderObjects that are not connected to the
// render tree at counter node creation. See bug 43812.
if (previousSibling && !previousSibling->parent())
return false;
CounterNode* currentCounter = makeCounterNode(currentRenderer, identifier, false);
if (searchEndRenderer == currentRenderer) {
// We may be at the end of our search.
......
......@@ -315,6 +315,7 @@ void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild)
// Just add it...
children->insertChildNode(this, newChild, beforeChild);
}
RenderCounter::rendererSubtreeAttached(newChild);
if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE) {
RefPtr<StringImpl> textToTransform = toRenderText(newChild)->originalText();
if (textToTransform)
......
......@@ -174,7 +174,6 @@ void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n
owner->dirtyLinesFromChangedChild(newChild);
}
RenderCounter::rendererSubtreeAttached(newChild);
newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing block hierarchy.
if (!owner->normalChildNeedsLayout())
owner->setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.
......@@ -234,7 +233,6 @@ void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c
owner->dirtyLinesFromChangedChild(child);
}
RenderCounter::rendererSubtreeAttached(child);
child->setNeedsLayoutAndPrefWidthsRecalc();
if (!owner->normalChildNeedsLayout())
owner->setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment