Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
| 10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 478 } | 478 } |
| 479 | 479 |
| 480 LayoutObject* object = m_paintLayer.layoutObject(); | 480 LayoutObject* object = m_paintLayer.layoutObject(); |
| 481 LayoutView* view = object->view(); | 481 LayoutView* view = object->view(); |
| 482 bool isFixedPosObjectInPagedMedia = object->style()->position() == FixedPosi tion && object->container() == view && view->pageLogicalHeight(); | 482 bool isFixedPosObjectInPagedMedia = object->style()->position() == FixedPosi tion && object->container() == view && view->pageLogicalHeight(); |
| 483 PaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLayer(); | 483 PaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLayer(); |
| 484 PaintLayerFragments fragments; | 484 PaintLayerFragments fragments; |
| 485 if (isFixedPosObjectInPagedMedia) { | 485 if (isFixedPosObjectInPagedMedia) { |
| 486 // "For paged media, boxes with fixed positions are repeated on every pa ge." | 486 // "For paged media, boxes with fixed positions are repeated on every pa ge." |
| 487 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning | 487 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning |
| 488 ASSERT(view->firstChild() && view->firstChild()->isLayoutBlock()); | 488 // TODO(rhogan): Figure out the correct behaviour for vertical writing m odes. |
|
Xianzhu
2016/06/08 21:14:06
Can you address the vertical writing mode issue (w
| |
| 489 int pages = static_cast<int>(ceilf(toLayoutBlock(view->firstChild())->lo gicalHeight() / view->pageLogicalHeight())); | 489 unsigned pages = ceilf(view->documentRect().height() / view->pageLogical Height()); |
| 490 LayoutPoint paginationOffset; | 490 LayoutPoint paginationOffset; |
| 491 for (int i = 0; i < pages; i++) { | 491 for (unsigned i = 0; i < pages; i++) { |
| 492 PaintLayerFragment fragment; | 492 PaintLayerFragment fragment; |
| 493 fragment.backgroundRect = paintingInfo.paintDirtyRect; | 493 fragment.backgroundRect = paintingInfo.paintDirtyRect; |
| 494 fragment.paginationOffset = paginationOffset; | 494 fragment.paginationOffset = paginationOffset; |
| 495 fragments.append(fragment); | 495 fragments.append(fragment); |
| 496 paginationOffset += LayoutPoint(0, view->pageLogicalHeight()); | 496 paginationOffset += LayoutPoint(0, view->pageLogicalHeight()); |
| 497 } | 497 } |
| 498 } else if (paginationLayer) { | 498 } else if (paginationLayer) { |
| 499 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any | 499 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any |
| 500 // issues in it & refactor to make it obvious from code structure what i t does and that it's | 500 // issues in it & refactor to make it obvious from code structure what i t does and that it's |
| 501 // correct. | 501 // correct. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 803 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 804 return; | 804 return; |
| 805 | 805 |
| 806 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); | 806 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); |
| 807 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 807 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 808 | 808 |
| 809 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 809 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 810 } | 810 } |
| 811 | 811 |
| 812 } // namespace blink | 812 } // namespace blink |
| OLD | NEW |