Changeset 53506 in webkit
- Timestamp:
- Jan 19, 2010 4:09:18 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53504 r53506 1 2010-01-19 Carol Szabo <carol.szabo@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 Another crazy counters bug 6 https://bugs.webkit.org/show_bug.cgi?id=11031 7 Added tests for dynamic DOM changes affecting counters. 8 9 * fast/css/counters/counter-increment-002.html: Added. 10 * fast/css/counters/counter-reset-000.html: Added. 11 * fast/css/counters/counter-reset-002.html: Added. 12 * fast/css/counters/counter-increment-002-expected.txt: Added. 13 * fast/css/counters/counter-reset-000-expected.txt: Added. 14 * fast/css/counters/counter-reset-002-expected.txt: Added. 15 1 16 2010-01-19 Alexey Proskuryakov <ap@apple.com> 2 17 -
trunk/WebCore/ChangeLog
r53503 r53506 1 2010-01-19 Carol Szabo <carol.szabo@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 Another crazy counters bug 6 https://bugs.webkit.org/show_bug.cgi?id=11031 7 8 This patch actually provides for counter updating when the style 9 of a renderer changes. 10 11 Tests: fast/css/counters/counter-increment-002.html 12 fast/css/counters/counter-reset-000.html 13 fast/css/counters/counter-reset-002.html 14 15 * rendering/RenderCounter.cpp: 16 (WebCore::RenderCounter::rendererStyleChanged): 17 This function is added to update the counter hierarchy in 18 response to changes to the style of a renderer. 19 * rendering/RenderCounter.h: 20 * rendering/RenderObject.cpp: 21 (WebCore::RenderObject::styleDidChange): 22 For changes that may include the counter directives added a 23 call to RenderCounter::rendererStyleChanged. 24 1 25 2010-01-19 Gustavo Noronha Silva <gns@gnome.org> 2 26 -
trunk/WebCore/rendering/RenderCounter.cpp
r53355 r53506 441 441 } 442 442 443 void RenderCounter::rendererStyleChanged(RenderObject* renderer, const RenderStyle* oldStyle, const RenderStyle* newStyle) 444 { 445 const CounterDirectiveMap* newCounterDirectives; 446 const CounterDirectiveMap* oldCounterDirectives; 447 if (oldStyle && (oldCounterDirectives = oldStyle->counterDirectives())) { 448 if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) { 449 CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives->end(); 450 CounterDirectiveMap::const_iterator oldMapEnd = oldCounterDirectives->end(); 451 for (CounterDirectiveMap::const_iterator it = newCounterDirectives->begin(); it != newMapEnd; ++it) { 452 CounterDirectiveMap::const_iterator oldMapIt = oldCounterDirectives->find(it->first); 453 if (oldMapIt != oldMapEnd) { 454 if (oldMapIt->second == it->second) 455 continue; 456 RenderCounter::destroyCounterNode(renderer, it->first.get()); 457 } 458 // We must create this node here, because the changed node may be a node with no display such as 459 // as those created by the increment or reset directives and the re-layout that will happen will 460 // not catch the change if the node had no children. 461 makeCounterNode(renderer, it->first.get(), false); 462 } 463 // Destroying old counters that do not exist in the new counterDirective map. 464 for (CounterDirectiveMap::const_iterator it = oldCounterDirectives->begin(); it !=oldMapEnd; ++it) { 465 if (!newCounterDirectives->contains(it->first)) 466 RenderCounter::destroyCounterNode(renderer, it->first.get()); 467 } 468 } else { 469 if (renderer->m_hasCounterNodeMap) 470 RenderCounter::destroyCounterNodes(renderer); 471 } 472 } else if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) { 473 CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives->end(); 474 for (CounterDirectiveMap::const_iterator it = newCounterDirectives->begin(); it != newMapEnd; ++it) { 475 // We must create this node here, because the added node may be a node with no display such as 476 // as those created by the increment or reset directives and the re-layout that will happen will 477 // not catch the change if the node had no children. 478 makeCounterNode(renderer, it->first.get(), false); 479 } 480 } 481 } 482 443 483 } // namespace WebCore -
trunk/WebCore/rendering/RenderCounter.h
r53355 r53506 43 43 static void destroyCounterNode(RenderObject*, const AtomicString& identifier); 44 44 static void rendererSubtreeAttached(RenderObject*); 45 static void rendererStyleChanged(RenderObject*, const RenderStyle* oldStyle, const RenderStyle* newStyle); 45 46 46 47 private: -
trunk/WebCore/rendering/RenderObject.cpp
r53476 r53506 1674 1674 } 1675 1675 1676 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* )1676 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 1677 1677 { 1678 1678 if (s_affectsParentBlock) … … 1682 1682 return; 1683 1683 1684 if (diff == StyleDifferenceLayout) 1684 if (diff == StyleDifferenceLayout) { 1685 RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get()); 1685 1686 setNeedsLayoutAndPrefWidthsRecalc(); 1686 else if (diff == StyleDifferenceLayoutPositionedMovementOnly)1687 } else if (diff == StyleDifferenceLayoutPositionedMovementOnly) 1687 1688 setNeedsPositionedMovementLayout(); 1688 1689
Note: See TracChangeset
for help on using the changeset viewer.