OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 textAutosizer->record(this); | 280 textAutosizer->record(this); |
281 | 281 |
282 propagateStyleToAnonymousChildren(true); | 282 propagateStyleToAnonymousChildren(true); |
283 | 283 |
284 // It's possible for our border/padding to change, but for the overall logic al width or height of the block to | 284 // It's possible for our border/padding to change, but for the overall logic al width or height of the block to |
285 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true. | 285 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true. |
286 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi calWidth); | 286 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi calWidth); |
287 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log icalHeight); | 287 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log icalHeight); |
288 } | 288 } |
289 | 289 |
290 void LayoutBlock::updateFromStyle() | |
291 { | |
292 LayoutBox::updateFromStyle(); | |
293 | |
294 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC lip(); | |
Xianzhu
2016/02/25 19:57:51
Moved from LayoutBox::updateFromStyle().
| |
295 if (shouldClipOverflow != hasOverflowClip()) { | |
296 // FIXME: This shouldn't be required if we tracked the visual overflow | |
297 // generated by positioned children or self painting layers. crbug.com/3 45403 | |
298 for (LayoutObject* child = firstChild(); child; child = child->nextSibli ng()) | |
299 child->setMayNeedPaintInvalidation(); | |
300 } | |
301 setHasOverflowClip(shouldClipOverflow); | |
302 } | |
303 | |
304 bool LayoutBlock::allowsOverflowClip() const | |
305 { | |
306 bool rootLayerScrolls = document().settings() && document().settings()->root LayerScrolls(); | |
307 return (rootLayerScrolls || !isLayoutView()) | |
308 // If overflow has been propagated to the viewport, it has no effect her e. | |
309 && node() != document().viewportDefiningElement(); | |
chrishtr
2016/02/26 19:42:16
It seems it would be slightly faster to write:
if
Xianzhu
2016/02/26 20:12:57
Separated out root scroll logic into LayoutView::a
| |
310 } | |
311 | |
290 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState) | 312 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState) |
291 { | 313 { |
292 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); | 314 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); |
293 | 315 |
294 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect. | 316 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect. |
295 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects ()) { | 317 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects ()) { |
296 for (auto* box : *positionedObjects) { | 318 for (auto* box : *positionedObjects) { |
297 | 319 |
298 // One of the layoutObjects we're skipping over here may be the chil d's paint invalidation container, | 320 // One of the layoutObjects we're skipping over here may be the chil d's paint invalidation container, |
299 // so we can't pass our own paint invalidation container along. | 321 // so we can't pass our own paint invalidation container along. |
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2862 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const | 2884 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const |
2863 { | 2885 { |
2864 showLayoutObject(); | 2886 showLayoutObject(); |
2865 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 2887 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
2866 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 2888 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
2867 } | 2889 } |
2868 | 2890 |
2869 #endif | 2891 #endif |
2870 | 2892 |
2871 } // namespace blink | 2893 } // namespace blink |
OLD | NEW |