Changeset 95573 in webkit
- Timestamp:
- Sep 20, 2011 3:23:41 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95570 r95573 1 2011-09-20 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=68480 4 5 De-virtualize containingBlock() and make RenderView return 0 instead 6 of itself to make the construction of normal loops that terminate via 7 a null-check possible. 8 9 Fix the only two places in the tree that needed null checks. 10 11 Eliminating RenderTableCell::containingBlock() is fine since the base class 12 does the same thing anyway. 13 14 Reviewed by Simon Fraser. 15 16 * editing/VisiblePosition.cpp: 17 (WebCore::VisiblePosition::lineDirectionPointForBlockDirectionNavigation): 18 * rendering/RenderObject.cpp: 19 (WebCore::RenderObject::containingBlock): 20 * rendering/RenderObject.h: 21 * rendering/RenderTableCell.cpp: 22 * rendering/RenderTableCell.h: 23 * rendering/RenderTreeAsText.cpp: 24 (WebCore::RenderTreeAsText::writeRenderObject): 25 * rendering/RenderView.cpp: 26 * rendering/RenderView.h: 27 1 28 2011-09-20 Anders Carlsson <andersca@apple.com> 2 29 -
trunk/Source/WebCore/editing/VisiblePosition.cpp
r93443 r95573 608 608 // relative to the text, not absolute 'up'. 609 609 FloatPoint caretPoint = renderer->localToAbsolute(localRect.location()); 610 return renderer->containingBlock()->isHorizontalWritingMode() ? caretPoint.x() : caretPoint.y(); 610 RenderObject* containingBlock = renderer->containingBlock(); 611 if (!containingBlock) 612 containingBlock = renderer; // Just use ourselves to determine the writing mode if we have no containing block. 613 return containingBlock->isHorizontalWritingMode() ? caretPoint.x() : caretPoint.y(); 611 614 } 612 615 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r95461 r95573 637 637 RenderBlock* RenderObject::containingBlock() const 638 638 { 639 ASSERT(!isTableCell());640 ASSERT(!isRenderView());641 642 639 RenderObject* o = parent(); 643 640 if (!isText() && m_style->position() == FixedPosition) { -
trunk/Source/WebCore/rendering/RenderObject.h
r95461 r95573 601 601 602 602 // returns the containing block level element for this element. 603 virtualRenderBlock* containingBlock() const;603 RenderBlock* containingBlock() const; 604 604 605 605 // Convert the given local point to absolute coordinates -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r94706 r95573 320 320 } 321 321 322 RenderBlock* RenderTableCell::containingBlock() const323 {324 if (parent() && section())325 return table();326 return 0;327 }328 329 322 // The following rules apply for resolving conflicts and figuring out which border 330 323 // to use. -
trunk/Source/WebCore/rendering/RenderTableCell.h
r94706 r95573 138 138 virtual bool isTableCell() const { return true; } 139 139 140 virtual RenderBlock* containingBlock() const;141 142 140 virtual void willBeDestroyed(); 143 141 -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r95239 r95573 247 247 } 248 248 249 bool adjustForTableCells = o.containingBlock()->isTableCell(); 249 RenderBlock* cb = o.containingBlock(); 250 bool adjustForTableCells = cb ? cb->isTableCell() : false; 250 251 251 252 IntRect r; -
trunk/Source/WebCore/rendering/RenderView.cpp
r95264 r95573 266 266 } 267 267 268 RenderBlock* RenderView::containingBlock() const269 {270 return const_cast<RenderView*>(this);271 }272 273 268 void RenderView::repaintViewRectangle(const IntRect& ur, bool immediate) 274 269 { -
trunk/Source/WebCore/rendering/RenderView.h
r95264 r95573 194 194 private: 195 195 bool shouldRepaint(const IntRect& r) const; 196 197 virtual RenderBlock* containingBlock() const;198 196 199 197 // These functions may only be accessed by LayoutStateMaintainer.
Note: See TracChangeset
for help on using the changeset viewer.