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(); |
| 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 // If overflow has been propagated to the viewport, it has no effect here. |
| 307 return node() != document().viewportDefiningElement(); |
| 308 } |
| 309 |
290 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil
dPaintInvalidationState) | 310 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil
dPaintInvalidationState) |
291 { | 311 { |
292 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); | 312 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); |
293 | 313 |
294 // Take care of positioned objects. This is required as PaintInvalidationSta
te keeps a single clip rect. | 314 // Take care of positioned objects. This is required as PaintInvalidationSta
te keeps a single clip rect. |
295 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects
()) { | 315 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects
()) { |
296 for (auto* box : *positionedObjects) { | 316 for (auto* box : *positionedObjects) { |
297 | 317 |
298 // One of the layoutObjects we're skipping over here may be the chil
d's paint invalidation container, | 318 // 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. | 319 // 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 | 2882 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
2863 { | 2883 { |
2864 showLayoutObject(); | 2884 showLayoutObject(); |
2865 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2885 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
2866 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2886 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
2867 } | 2887 } |
2868 | 2888 |
2869 #endif | 2889 #endif |
2870 | 2890 |
2871 } // namespace blink | 2891 } // namespace blink |
OLD | NEW |