Changeset 57080 in webkit
- Timestamp:
- Apr 5, 2010 10:18:12 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57079 r57080 1 2010-04-01 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Reviewed by Dave Hyatt. 4 5 iframe flattening doesn't flatten 6 https://bugs.webkit.org/show_bug.cgi?id=36798 7 8 Fixed to the iframe flattening code so that the iframes on 9 http://www.samisite.com/test-csb2nf/id43.htm are actually 10 flattened. 11 12 Covered by current tests. 13 14 * page/FrameView.cpp: Propagate contents changes of iframes 15 and subframes in framesets to the parent so that it is relayouted 16 (WebCore::FrameView::setContentsSize): 17 (WebCore::FrameView::adjustViewSize): 18 (WebCore::FrameView::scheduleRelayout): 19 * rendering/RenderPart.cpp: HTMLIFrameElement do not inherit from 20 HTMLFrameElement, but HTMLFrameElementBase, correct cast. Correct 21 the use of inset border values. Avoid a sometimes unnecessary 22 relayout. 23 (WebCore::RenderPart::layoutWithFlattening): 24 * rendering/RenderPartObject.cpp: Make the calcHeight and calcWidth 25 return the right values, considering scrolling and fixed width/height 26 (WebCore::RenderPartObject::flattenFrame): 27 (WebCore::RenderPartObject::calcHeight): 28 (WebCore::RenderPartObject::calcWidth): 29 (WebCore::RenderPartObject::layout): 30 1 31 2010-04-05 Vitaly Repeshko <vitalyr@chromium.org> 2 32 -
trunk/WebCore/page/FrameView.cpp
r57009 r57080 398 398 399 399 page->chrome()->contentsSizeChanged(frame(), size); //notify only 400 400 401 401 m_deferSetNeedsLayouts--; 402 402 … … 411 411 if (!root) 412 412 return; 413 413 414 setContentsSize(IntSize(root->rightLayoutOverflow(), root->bottomLayoutOverflow())); 414 415 } … … 1276 1277 return; 1277 1278 1278 // When frame setflattening is enabled, the contents of the frame affects layout of the parent frames.1279 // When frame flattening is enabled, the contents of the frame affects layout of the parent frames. 1279 1280 // Also invalidate parent frame starting from the owner element of this frame. 1280 if (m_frame->settings()->frameFlatteningEnabled() && m_frame->ownerRenderer() && m_frame->ownerElement()->hasTagName(frameTag)) 1281 m_frame->ownerRenderer()->setNeedsLayout(true, true); 1281 if (m_frame->settings()->frameFlatteningEnabled() && m_frame->ownerRenderer()) { 1282 if (m_frame->ownerElement()->hasTagName(iframeTag) || m_frame->ownerElement()->hasTagName(frameTag)) 1283 m_frame->ownerRenderer()->setNeedsLayout(true, true); 1284 } 1282 1285 1283 1286 int delay = m_frame->document()->minimumLayoutDelay(); -
trunk/WebCore/rendering/RenderPart.cpp
r56854 r57080 28 28 #include "Frame.h" 29 29 #include "FrameView.h" 30 #include "HTMLFrameElement .h"30 #include "HTMLFrameElementBase.h" 31 31 32 32 namespace WebCore { … … 61 61 FrameView* childFrameView = static_cast<FrameView*>(widget()); 62 62 RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0; 63 HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());64 63 65 64 // Do not expand frames which has zero width or height … … 81 80 // no subframe much ever become scrollable. 82 81 82 HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node()); 83 83 bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff; 84 84 85 // consider iframe inset border 86 int hBorder = borderLeft() + borderRight(); 87 int vBorder = borderTop() + borderBottom(); 88 85 89 // make sure minimum preferred width is enforced 86 if (isScrollable || !fixedWidth) 87 setWidth(max(width(), childRoot->minPrefWidth() ));88 89 // update again to pass the width to the child frame90 updateWidgetPosition();91 childFrameView->layout();90 if (isScrollable || !fixedWidth) { 91 setWidth(max(width(), childRoot->minPrefWidth() + hBorder)); 92 // update again to pass the new width to the child frame 93 updateWidgetPosition(); 94 childFrameView->layout(); 95 } 92 96 93 97 // expand the frame by setting frame height = content height 94 98 if (isScrollable || !fixedHeight || childRoot->isFrameSet()) 95 setHeight(max(height(), childFrameView->contentsHeight() ));99 setHeight(max(height(), childFrameView->contentsHeight() + vBorder)); 96 100 if (isScrollable || !fixedWidth || childRoot->isFrameSet()) 97 setWidth(max(width(), childFrameView->contentsWidth())); 98 99 // make room for the inset border 100 setWidth(width() + borderLeft() + borderRight()); 101 setHeight(height() + borderTop() + borderBottom()); 101 setWidth(max(width(), childFrameView->contentsWidth() + hBorder)); 102 102 103 103 updateWidgetPosition(); -
trunk/WebCore/rendering/RenderPartObject.cpp
r56852 r57080 57 57 return false; 58 58 59 HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); 59 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node()); 60 bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff; 60 61 61 if (element->scrollingMode() == ScrollbarAlwaysOff 62 && style()->width().isFixed() 62 if (!isScrollable && style()->width().isFixed() 63 63 && style()->height().isFixed()) 64 64 return false; 65 65 66 Document* document = element ? element->document() : 0; 67 return document->frame() && document->frame()->settings()->frameFlatteningEnabled(); 66 return frame->document()->frame() && frame->document()->frame()->settings()->frameFlatteningEnabled(); 68 67 } 69 68 … … 71 70 { 72 71 RenderPart::calcHeight(); 73 if (flattenFrame()) 74 setHeight(max(height(), static_cast<FrameView*>(widget())->contentsHeight())); 72 if (!flattenFrame()) 73 return; 74 75 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node()); 76 bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff; 77 78 if (isScrollable || !style()->height().isFixed()) { 79 FrameView* view = static_cast<FrameView*>(widget()); 80 int border = borderTop() + borderBottom(); 81 setHeight(max(height(), view->contentsHeight() + border)); 82 } 75 83 } 76 84 … … 78 86 { 79 87 RenderPart::calcWidth(); 80 if (flattenFrame()) 81 setWidth(max(width(), static_cast<FrameView*>(widget())->contentsWidth())); 88 if (!flattenFrame()) 89 return; 90 91 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node()); 92 bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff; 93 94 if (isScrollable || !style()->width().isFixed()) { 95 FrameView* view = static_cast<FrameView*>(widget()); 96 int border = borderLeft() + borderRight(); 97 setWidth(max(width(), view->contentsWidth() + border)); 98 } 82 99 } 83 100 … … 86 103 ASSERT(needsLayout()); 87 104 88 calcWidth();89 calcHeight();105 RenderPart::calcWidth(); 106 RenderPart::calcHeight(); 90 107 91 108 if (flattenFrame()) {
Note: See TracChangeset
for help on using the changeset viewer.