Changeset 129046 in webkit
- Timestamp:
- Sep 19, 2012 2:47:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129041 r129046 1 2012-09-19 Tony Chang <tony@chromium.org> 2 3 Remove RenderIFrame::updateLogicalHeight and RenderIFrame::updateLogicalWidth 4 https://bugs.webkit.org/show_bug.cgi?id=97049 5 6 Reviewed by Ojan Vafai. 7 8 This is an incremental step in making updateLogicalHeight non-virtual so it's 9 possible to call computeLogicalHeight on any RenderBox and get the right 10 version of the function. 11 12 The code in RenderIFrame::layout was calling flattenFrame(), which would 13 query it's bounding box size. Since we hadn't done a layout yet, the size 14 is unknown. The fix is to only call flattenFrame() after calling 15 updateLogicalWidth and updateLogicalHeight. We can then fixup the size of 16 the iframe. 17 18 No new tests, existing tests in fast/frames/flattening should continue to pass. 19 20 * rendering/RenderIFrame.cpp: 21 (WebCore::RenderIFrame::layout): 22 * rendering/RenderIFrame.h: 23 (RenderIFrame): 24 1 25 2012-09-19 Joshua Bell <jsbell@chromium.org> 2 26 -
trunk/Source/WebCore/rendering/RenderIFrame.cpp
r128201 r129046 42 42 : RenderFrameBase(element) 43 43 { 44 }45 46 void RenderIFrame::updateLogicalHeight()47 {48 RenderPart::updateLogicalHeight();49 if (!flattenFrame())50 return;51 52 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());53 bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;54 55 if (isScrollable || !style()->height().isFixed()) {56 FrameView* view = static_cast<FrameView*>(widget());57 if (!view)58 return;59 int border = borderTop() + borderBottom();60 setHeight(max<LayoutUnit>(height(), view->contentsHeight() + border));61 }62 }63 64 void RenderIFrame::updateLogicalWidth()65 {66 // When we're seamless, we behave like a block. Thankfully RenderBox has all the right logic for this.67 if (isSeamless())68 return RenderBox::updateLogicalWidth();69 70 RenderPart::updateLogicalWidth();71 if (!flattenFrame())72 return;73 74 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());75 bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;76 77 if (isScrollable || !style()->width().isFixed()) {78 FrameView* view = static_cast<FrameView*>(widget());79 if (!view)80 return;81 LayoutUnit border = borderLeft() + borderRight();82 setWidth(max<LayoutUnit>(width(), view->contentsWidth() + border));83 }84 44 } 85 45 … … 190 150 ASSERT(needsLayout()); 191 151 192 if (flattenFrame()) { 193 RenderPart::updateLogicalWidth(); 194 RenderPart::updateLogicalHeight(); 195 layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed()); 196 // FIXME: Is early return really OK here? What about transform/overflow code below? 197 return; 198 } else if (isSeamless()) { 152 if (isSeamless()) { 199 153 layoutSeamlessly(); 200 154 // Do not return so as to share the layer and overflow updates below. … … 203 157 // No kids to layout as a replaced element. 204 158 updateLogicalHeight(); 159 160 if (flattenFrame()) 161 layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed()); 205 162 } 206 163 -
trunk/Source/WebCore/rendering/RenderIFrame.h
r128201 r129046 41 41 42 42 private: 43 virtual void updateLogicalWidth() OVERRIDE;44 virtual void updateLogicalHeight() OVERRIDE;45 46 43 virtual LayoutUnit minPreferredLogicalWidth() const OVERRIDE; 47 44 virtual LayoutUnit maxPreferredLogicalWidth() const OVERRIDE;
Note: See TracChangeset
for help on using the changeset viewer.