Changeset 143256 in webkit
- Timestamp:
- Feb 18, 2013 1:20:27 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143241 r143256 1 2013-02-18 David Hyatt <hyatt@apple.com> 2 3 Make seamless iframes paginate properly in their enclosing document's pagination context. 4 https://bugs.webkit.org/show_bug.cgi?id=106125 5 <rdar://problem/12922720> Text in iframe is clipped while printing 6 7 Reviewed by Simon Fraser. 8 9 Added new tests in fast/multicol and fast/region. 10 11 * fast/multicol/resources/ipad.jpg: Added. 12 * fast/multicol/resources/seamless.html: Added. 13 * fast/multicol/seamless-flowed-through-columns-expected.html: Added. 14 * fast/multicol/seamless-flowed-through-columns.html: Added. 15 * fast/regions/resources/ipad.jpg: Added. 16 * fast/regions/resources/seamless.html: Added. 17 * fast/regions/seamless-iframe-flowed-into-regions-expected.html: Added. 18 * fast/regions/seamless-iframe-flowed-into-regions.html: Added. 19 1 20 2013-02-17 Filip Pizlo <fpizlo@apple.com> 2 21 -
trunk/LayoutTests/platform/mac/TestExpectations
r143110 r143256 446 446 fast/regions/style-scoped-in-flow-override-region-styling.html 447 447 fast/regions/style-scoped-in-flow.html 448 449 # seamless iframes exhibit odd repaint issues in regions and columns, but only in DumpRenderTree 450 fast/regions/seamless-iframe-flowed-into-regions.html 451 fast/multicol/seamless-flowed-through-columns.html 448 452 449 453 # ENABLE(SHADOW_DOM) is disabled. -
trunk/Source/WebCore/ChangeLog
r143244 r143256 1 2013-02-18 David Hyatt <hyatt@apple.com> 2 3 Make seamless iframes paginate properly in their enclosing document's pagination context. 4 https://bugs.webkit.org/show_bug.cgi?id=106125 5 <rdar://problem/12922720> Text in iframe is clipped while printing 6 7 Reviewed by Simon Fraser. 8 9 Added new tests in fast/multicol and fast/region. 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::clampToStartAndEndRegions): 13 Don't clamp when the RenderView is the containing block of an object in a RenderFlowThread. 14 15 * rendering/RenderObject.cpp: 16 (WebCore::RenderObject::containerForRepaint): 17 Don't attempt any repaint container antics when we're in a seamless iframe, since the ancestor 18 document will actually do the handoff into the flow thread. 19 20 * rendering/RenderView.cpp: 21 (WebCore::enclosingSeamlessRenderer): 22 Heper function to test for an enclosing seamless iframe. 23 24 (WebCore::RenderView::addChild): 25 Subclass addChild on RenderView to properly set the inRenderFlowThread state for a seamless 26 child document so thta it will check regions. 27 28 (WebCore::RenderView::initializeLayoutState): 29 New helper method for setting up the initial layout state of a RenderView. If inside a seamless 30 paginated ancestor, set up the appropriate pagination information so the child document 31 knows about it. This method will expand to inherit info about line grids and exclusions eventually 32 also. 33 34 (WebCore::RenderView::layout): 35 Now calls initializeLayoutState to set up the layout state. 36 37 * rendering/RenderView.h: 38 (WebCore::RenderView::pageLogicalHeight): 39 (WebCore::RenderView::setPageLogicalHeight): 40 (RenderView): 41 Fix the type of the page logical height methods to be LayoutUnit instead of unsigned. 42 1 43 2013-02-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 44 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r143225 r143256 7570 7570 RenderRegion* RenderBlock::clampToStartAndEndRegions(RenderRegion* region) const 7571 7571 { 7572 ASSERT(region && inRenderFlowThread()); 7573 7572 ASSERT(isRenderView() || (region && inRenderFlowThread())); 7573 if (isRenderView()) 7574 return region; 7575 7574 7576 // We need to clamp to the block, since we want any lines or blocks that overflow out of the 7575 7577 // logical top or logical bottom of the block to size as though the border box in the first and -
trunk/Source/WebCore/rendering/RenderObject.cpp
r142956 r143256 1299 1299 if (inRenderFlowThread()) { 1300 1300 RenderFlowThread* parentRenderFlowThread = enclosingRenderFlowThread(); 1301 // The ancestor document will do the reparenting when the repaint propagates further up. 1302 // We're just a seamless child document, and we don't need to do the hacking. 1303 if (parentRenderFlowThread && parentRenderFlowThread->document() != document()) 1304 return repaintContainer; 1301 1305 // If we have already found a repaint container then we will repaint into that container only if it is part of the same 1302 1306 // flow thread. Otherwise we will need to catch the repaint call and send it to the flow thread. -
trunk/Source/WebCore/rendering/RenderView.cpp
r142885 r143256 31 31 #include "GraphicsContext.h" 32 32 #include "HTMLFrameOwnerElement.h" 33 #include "HTMLIFrameElement.h" 33 34 #include "HitTestResult.h" 34 35 #include "Page.h" … … 146 147 #endif 147 148 149 static RenderBox* enclosingSeamlessRenderer(Document* doc) 150 { 151 if (!doc) 152 return 0; 153 Element* ownerElement = doc->seamlessParentIFrame(); 154 if (!ownerElement) 155 return 0; 156 return ownerElement->renderBox(); 157 } 158 159 void RenderView::addChild(RenderObject* newChild, RenderObject* beforeChild) 160 { 161 // Seamless iframes are considered part of an enclosing render flow thread from the parent document. This is necessary for them to look 162 // up regions in the parent document during layout. 163 if (newChild && !newChild->isRenderFlowThread()) { 164 RenderBox* seamlessBox = enclosingSeamlessRenderer(document()); 165 if (seamlessBox && seamlessBox->inRenderFlowThread()) 166 newChild->setInRenderFlowThread(); 167 } 168 RenderBlock::addChild(newChild, beforeChild); 169 } 170 171 bool RenderView::initializeLayoutState(LayoutState& state) 172 { 173 bool isSeamlessAncestorInFlowThread = false; 174 175 // FIXME: May be better to push a clip and avoid issuing offscreen repaints. 176 state.m_clipped = false; 177 178 // Check the writing mode of the seamless ancestor. It has to match our document's writing mode, or we won't inherit any 179 // pagination information. 180 RenderBox* seamlessAncestor = enclosingSeamlessRenderer(document()); 181 LayoutState* seamlessLayoutState = seamlessAncestor ? seamlessAncestor->view()->layoutState() : 0; 182 bool shouldInheritPagination = seamlessLayoutState && !m_pageLogicalHeight && seamlessAncestor->style()->writingMode() == style()->writingMode(); 183 184 state.m_pageLogicalHeight = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeight : m_pageLogicalHeight; 185 state.m_pageLogicalHeightChanged = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeightChanged : m_pageLogicalHeightChanged; 186 state.m_isPaginated = state.m_pageLogicalHeight; 187 if (state.m_isPaginated && shouldInheritPagination) { 188 // Set up the correct pagination offset. We can use a negative offset in order to push the top of the RenderView into its correct place 189 // on a page. We can take the iframe's offset from the logical top of the first page and make the negative into the pagination offset within the child 190 // view. 191 bool isFlipped = seamlessAncestor->style()->isFlippedBlocksWritingMode(); 192 LayoutSize layoutOffset = seamlessLayoutState->layoutOffset(); 193 LayoutSize iFrameOffset(layoutOffset.width() + seamlessAncestor->x() + (!isFlipped ? seamlessAncestor->borderLeft() + seamlessAncestor->paddingLeft() : 194 seamlessAncestor->borderRight() + seamlessAncestor->paddingRight()), 195 layoutOffset.height() + seamlessAncestor->y() + (!isFlipped ? seamlessAncestor->borderTop() + seamlessAncestor->paddingTop() : 196 seamlessAncestor->borderBottom() + seamlessAncestor->paddingBottom())); 197 198 LayoutSize offsetDelta = seamlessLayoutState->m_pageOffset - iFrameOffset; 199 state.m_pageOffset = offsetDelta; 200 201 // Set the current render flow thread to point to our ancestor. This will allow the seamless document to locate the correct 202 // regions when doing a layout. 203 if (seamlessAncestor->inRenderFlowThread()) { 204 flowThreadController()->setCurrentRenderFlowThread(seamlessAncestor->view()->flowThreadController()->currentRenderFlowThread()); 205 isSeamlessAncestorInFlowThread = true; 206 } 207 } 208 209 // FIXME: We need to make line grids and exclusions work with seamless iframes as well here. Basically all layout state information needs 210 // to propagate here and not just pagination information. 211 return isSeamlessAncestorInFlowThread; 212 } 213 148 214 // The algorithm to layout the flow thread content in auto height regions has to make sure 149 215 // that when a two-pass layout is needed, the auto height regions always start the first … … 204 270 205 271 LayoutState state; 206 // FIXME: May be better to push a clip and avoid issuing offscreen repaints. 207 state.m_clipped = false; 208 state.m_pageLogicalHeight = m_pageLogicalHeight; 209 state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged; 210 state.m_isPaginated = state.m_pageLogicalHeight; 272 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state); 273 211 274 m_pageLogicalHeightChanged = false; 212 275 m_layoutState = &state; … … 223 286 m_layoutState = 0; 224 287 setNeedsLayout(false); 288 289 if (isSeamlessAncestorInFlowThread) 290 flowThreadController()->setCurrentRenderFlowThread(0); 225 291 } 226 292 -
trunk/Source/WebCore/rendering/RenderView.h
r142885 r143256 160 160 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); 161 161 162 unsignedpageLogicalHeight() const { return m_pageLogicalHeight; }163 void setPageLogicalHeight( unsignedheight)162 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } 163 void setPageLogicalHeight(LayoutUnit height) 164 164 { 165 165 if (m_pageLogicalHeight != height) { … … 230 230 void removeRenderCounter() { ASSERT(m_renderCounterCount > 0); m_renderCounterCount--; } 231 231 bool hasRenderCounters() { return m_renderCounterCount; } 232 233 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE; 232 234 233 235 protected: … … 236 238 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const; 237 239 virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; 238 240 239 241 private: 242 bool initializeLayoutState(LayoutState&); 243 240 244 virtual void calcColumnWidth() OVERRIDE; 241 245 virtual ColumnInfo::PaginationUnit paginationUnit() const OVERRIDE; … … 324 328 bool shouldUsePrintingLayout() const; 325 329 326 unsignedm_pageLogicalHeight;330 LayoutUnit m_pageLogicalHeight; 327 331 bool m_pageLogicalHeightChanged; 328 332 LayoutState* m_layoutState;
Note: See TracChangeset
for help on using the changeset viewer.