Changeset 27952 in webkit
- Timestamp:
- Nov 21, 2007 9:23:20 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r27939 r27952 1 2007-11-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Eric Seidel. 4 5 - repaint test for <rdar://problem/5607037> REGRESSION (r27351): Departure date does not repaint when changed on Google Maps public transit planner (16034) 6 7 * fast/repaint/subtree-root-skipped.html: Added. 8 * platform/mac-leopard/fast/repaint/subtree-root-skipped-expected.checksum: Added. 9 * platform/mac-leopard/fast/repaint/subtree-root-skipped-expected.png: Added. 10 * platform/mac/fast/repaint/subtree-root-skipped-expected.txt: Added. 11 1 12 2007-11-21 Alexey Proskuryakov <ap@webkit.org> 2 13 -
trunk/WebCore/ChangeLog
r27951 r27952 1 2007-11-21 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Eric Seidel. 4 5 - fix <rdar://problem/5607037> REGRESSION (r27351): Departure date does not repaint when changed on Google Maps public transit planner (16034) 6 7 Test: fast/repaint/subtree-root-skipped.html 8 9 * page/FrameView.cpp: 10 (WebCore::FrameViewPrivate::FrameViewPrivate): Initialize the layout 11 root to 0. 12 (WebCore::FrameView::layoutRoot): Changed to return a RenderObject 13 instead of a Node. 14 (WebCore::FrameView::layout): Changed for layout root being a renderer 15 rather than a DOM node. Also replaced clearing the repaint rects 16 set with asserting that it is empty if this is the top-level call to 17 layout(). If it is not, the set may contain rects from enclosing 18 layout() and those should not be removed. 19 (WebCore::FrameView::scheduleRelayout): Changed for layout root being 20 a renderer rather than a DOM node. 21 (WebCore::isObjectAncestorContainerOf): Added this helper function that 22 tests whether one object will be marked by calling 23 markContainingBlocksForLayout() on the other. 24 (WebCore::FrameView::scheduleRelayoutOfSubtree): Changed for layout 25 root being a renderer rather than a DOM node. Changed the check if new 26 and current layout roots are on the same path from the root to use 27 the subgraph of the render tree defined by container()hood instead of 28 the DOM tree and parenthood. 29 * page/FrameView.h: 30 * rendering/RenderBox.cpp: 31 (WebCore::RenderBox::calcWidth): Changed for layout root being a 32 renderer rather than a DOM node. 33 * rendering/RenderObject.cpp: 34 (WebCore::RenderObject::~RenderObject): Added an assertion that the 35 object being deleted is not currently the layout root. 36 (WebCore::RenderObject::scheduleRelayout): Changed for layout root being 37 a renderer rather than a DOM node. 38 1 39 2007-11-21 Mark Rowe <mrowe@apple.com> 2 40 -
trunk/WebCore/page/FrameView.cpp
r27351 r27952 58 58 : m_slowRepaintObjectCount(0) 59 59 , layoutTimer(view, &FrameView::layoutTimerFired) 60 , layoutRoot(0) 60 61 , m_mediaType("screen") 61 62 , m_enqueueEvents(0) … … 100 101 Timer<FrameView> layoutTimer; 101 102 bool delayedLayout; 102 Re fPtr<Node>layoutRoot;103 RenderObject* layoutRoot; 103 104 104 105 bool layoutSchedulingEnabled; … … 284 285 } 285 286 286 Node* FrameView::layoutRoot() const287 { 288 return layoutPending() ? 0 : d->layoutRoot .get();287 RenderObject* FrameView::layoutRoot() const 288 { 289 return layoutPending() ? 0 : d->layoutRoot; 289 290 } 290 291 … … 313 314 314 315 if (!allowSubtree && d->layoutRoot) { 315 if (d->layoutRoot->renderer()) 316 d->layoutRoot->renderer()->markContainingBlocksForLayout(false); 316 d->layoutRoot->markContainingBlocksForLayout(false); 317 317 d->layoutRoot = 0; 318 318 } … … 336 336 337 337 bool subtree = d->layoutRoot; 338 Node* rootNode = subtree ? d->layoutRoot.get() : document;339 338 340 339 // If there is only one ref to this view left, then its going to be destroyed as soon as we exit, … … 343 342 return; 344 343 345 RenderObject* root = rootNode->renderer();344 RenderObject* root = subtree ? d->layoutRoot : document->renderer(); 346 345 if (!root) { 347 346 // FIXME: Do we need to set m_size here? … … 356 355 357 356 if (!subtree) { 358 Document* document = static_cast<Document*>(rootNode);359 357 RenderObject* rootRenderer = document->documentElement() ? document->documentElement()->renderer() : 0; 360 358 if (document->isHTMLDocument()) { … … 385 383 386 384 d->doFullRepaint = !subtree && (d->firstLayout || static_cast<RenderView*>(root)->printing()); 387 d->repaintRects.clear();385 ASSERT(d->nestedLayoutCount > 1 || d->repaintRects.isEmpty()); 388 386 389 387 bool didFirstLayout = false; … … 690 688 691 689 if (d->layoutRoot) { 692 if (d->layoutRoot->renderer()) 693 d->layoutRoot->renderer()->markContainingBlocksForLayout(false); 690 d->layoutRoot->markContainingBlocksForLayout(false); 694 691 d->layoutRoot = 0; 695 692 } … … 716 713 } 717 714 718 void FrameView::scheduleRelayoutOfSubtree(Node* n) 715 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* descendant) 716 { 717 for (RenderObject* r = descendant; r; r = r->container()) { 718 if (r == ancestor) 719 return true; 720 } 721 return false; 722 } 723 724 void FrameView::scheduleRelayoutOfSubtree(RenderObject* o) 719 725 { 720 726 ASSERT(m_frame->view() == this); … … 723 729 && m_frame->document()->renderer() 724 730 && m_frame->document()->renderer()->needsLayout())) { 725 if ( n->renderer())726 n->renderer()->markContainingBlocksForLayout(false);731 if (o) 732 o->markContainingBlocksForLayout(false); 727 733 return; 728 734 } 729 735 730 736 if (layoutPending()) { 731 if (d->layoutRoot != n) {732 if ( n->isDescendantOf(d->layoutRoot.get())) {737 if (d->layoutRoot != o) { 738 if (isObjectAncestorContainerOf(d->layoutRoot, o)) { 733 739 // Keep the current root 734 if (n->renderer()) 735 n->renderer()->markContainingBlocksForLayout(false); 736 } else if (d->layoutRoot && d->layoutRoot->isDescendantOf(n)) { 737 // Re-root at n 738 if (d->layoutRoot->renderer()) 739 d->layoutRoot->renderer()->markContainingBlocksForLayout(false); 740 d->layoutRoot = n; 740 o->markContainingBlocksForLayout(false); 741 } else if (d->layoutRoot && isObjectAncestorContainerOf(o, d->layoutRoot)) { 742 // Re-root at o 743 d->layoutRoot->markContainingBlocksForLayout(false); 744 d->layoutRoot = o; 741 745 } else { 742 746 // Just do a full relayout 743 if (d->layoutRoot && d->layoutRoot->renderer())744 d->layoutRoot-> renderer()->markContainingBlocksForLayout(false);747 if (d->layoutRoot) 748 d->layoutRoot->markContainingBlocksForLayout(false); 745 749 d->layoutRoot = 0; 746 if (n->renderer()) 747 n->renderer()->markContainingBlocksForLayout(false); 750 o->markContainingBlocksForLayout(false); 748 751 } 749 752 } 750 753 } else { 751 754 int delay = m_frame->document()->minimumLayoutDelay(); 752 d->layoutRoot = n;755 d->layoutRoot = o; 753 756 d->delayedLayout = delay != 0; 754 757 d->layoutTimer.startOneShot(delay * 0.001); -
trunk/WebCore/page/FrameView.h
r27598 r27952 73 73 void layoutTimerFired(Timer<FrameView>*); 74 74 void scheduleRelayout(); 75 void scheduleRelayoutOfSubtree( Node*);75 void scheduleRelayoutOfSubtree(RenderObject*); 76 76 void unscheduleRelayout(); 77 77 bool layoutPending() const; 78 78 79 Node* layoutRoot() const;79 RenderObject* layoutRoot() const; 80 80 int layoutCount() const; 81 81 -
trunk/WebCore/rendering/RenderBox.cpp
r27743 r27952 1082 1082 1083 1083 // If layout is limited to a subtree, the subtree root's width does not change. 1084 if (node() && view()->frameView() && view()->frameView()->layoutRoot() == node())1084 if (node() && view()->frameView() && view()->frameView()->layoutRoot() == this) 1085 1085 return; 1086 1086 -
trunk/WebCore/rendering/RenderObject.cpp
r27611 r27952 202 202 RenderObject::~RenderObject() 203 203 { 204 ASSERT(!node() || !document()->frame()->view() || document()->frame()->view()->layoutRoot() != this); 204 205 #ifndef NDEBUG 205 206 --RenderObjectCounter::count; … … 2734 2735 FrameView* v = view() ? view()->frameView() : 0; 2735 2736 if (v) 2736 v->scheduleRelayoutOfSubtree( node());2737 v->scheduleRelayoutOfSubtree(this); 2737 2738 } 2738 2739 }
Note: See TracChangeset
for help on using the changeset viewer.