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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
35 #include "core/frame/PinchViewport.h" | 35 #include "core/frame/PinchViewport.h" |
36 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
37 #include "core/html/HTMLElement.h" | 37 #include "core/html/HTMLElement.h" |
38 #include "core/html/HTMLFrameElementBase.h" | 38 #include "core/html/HTMLFrameElementBase.h" |
39 #include "core/html/HTMLFrameOwnerElement.h" | 39 #include "core/html/HTMLFrameOwnerElement.h" |
40 #include "core/layout/HitTestResult.h" | 40 #include "core/layout/HitTestResult.h" |
41 #include "core/layout/Layer.h" | 41 #include "core/layout/Layer.h" |
42 #include "core/layout/LayoutGeometryMap.h" | 42 #include "core/layout/LayoutGeometryMap.h" |
| 43 #include "core/layout/LayoutGrid.h" |
43 #include "core/layout/LayoutListBox.h" | 44 #include "core/layout/LayoutListBox.h" |
44 #include "core/layout/LayoutListMarker.h" | 45 #include "core/layout/LayoutListMarker.h" |
45 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 46 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
46 #include "core/layout/LayoutScrollbarPart.h" | 47 #include "core/layout/LayoutScrollbarPart.h" |
47 #include "core/layout/LayoutTableCell.h" | 48 #include "core/layout/LayoutTableCell.h" |
48 #include "core/layout/PaintInfo.h" | 49 #include "core/layout/PaintInfo.h" |
49 #include "core/layout/compositing/LayerCompositor.h" | 50 #include "core/layout/compositing/LayerCompositor.h" |
50 #include "core/layout/style/ShadowList.h" | 51 #include "core/layout/style/ShadowList.h" |
51 #include "core/page/AutoscrollController.h" | 52 #include "core/page/AutoscrollController.h" |
52 #include "core/page/EventHandler.h" | 53 #include "core/page/EventHandler.h" |
53 #include "core/page/Page.h" | 54 #include "core/page/Page.h" |
54 #include "core/paint/BackgroundImageGeometry.h" | 55 #include "core/paint/BackgroundImageGeometry.h" |
55 #include "core/paint/BoxPainter.h" | 56 #include "core/paint/BoxPainter.h" |
56 #include "core/rendering/RenderDeprecatedFlexibleBox.h" | 57 #include "core/rendering/RenderDeprecatedFlexibleBox.h" |
57 #include "core/rendering/RenderFlexibleBox.h" | 58 #include "core/rendering/RenderFlexibleBox.h" |
58 #include "core/rendering/RenderGrid.h" | |
59 #include "core/rendering/RenderInline.h" | 59 #include "core/rendering/RenderInline.h" |
60 #include "core/rendering/RenderView.h" | 60 #include "core/rendering/RenderView.h" |
61 #include "platform/LengthFunctions.h" | 61 #include "platform/LengthFunctions.h" |
62 #include "platform/geometry/FloatQuad.h" | 62 #include "platform/geometry/FloatQuad.h" |
63 #include "platform/geometry/FloatRoundedRect.h" | 63 #include "platform/geometry/FloatRoundedRect.h" |
64 #include "platform/geometry/TransformState.h" | 64 #include "platform/geometry/TransformState.h" |
65 #include "platform/graphics/paint/DisplayItemList.h" | 65 #include "platform/graphics/paint/DisplayItemList.h" |
66 #include <algorithm> | 66 #include <algorithm> |
67 #include <math.h> | 67 #include <math.h> |
68 | 68 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 ShapeOutsideInfo::removeInfo(*this); | 273 ShapeOutsideInfo::removeInfo(*this); |
274 else | 274 else |
275 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); | 275 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); |
276 | 276 |
277 if (shapeOutside || shapeOutside != oldShapeOutside) | 277 if (shapeOutside || shapeOutside != oldShapeOutside) |
278 markShapeOutsideDependentsForLayout(); | 278 markShapeOutsideDependentsForLayout(); |
279 } | 279 } |
280 | 280 |
281 void LayoutBox::updateGridPositionAfterStyleChange(const LayoutStyle* oldStyle) | 281 void LayoutBox::updateGridPositionAfterStyleChange(const LayoutStyle* oldStyle) |
282 { | 282 { |
283 if (!oldStyle || !parent() || !parent()->isRenderGrid()) | 283 if (!oldStyle || !parent() || !parent()->isLayoutGrid()) |
284 return; | 284 return; |
285 | 285 |
286 if (oldStyle->gridColumnStart() == style()->gridColumnStart() | 286 if (oldStyle->gridColumnStart() == style()->gridColumnStart() |
287 && oldStyle->gridColumnEnd() == style()->gridColumnEnd() | 287 && oldStyle->gridColumnEnd() == style()->gridColumnEnd() |
288 && oldStyle->gridRowStart() == style()->gridRowStart() | 288 && oldStyle->gridRowStart() == style()->gridRowStart() |
289 && oldStyle->gridRowEnd() == style()->gridRowEnd() | 289 && oldStyle->gridRowEnd() == style()->gridRowEnd() |
290 && oldStyle->order() == style()->order() | 290 && oldStyle->order() == style()->order() |
291 && oldStyle->hasOutOfFlowPosition() == style()->hasOutOfFlowPosition()) | 291 && oldStyle->hasOutOfFlowPosition() == style()->hasOutOfFlowPosition()) |
292 return; | 292 return; |
293 | 293 |
294 // It should be possible to not dirty the grid in some cases (like moving an
explicitly placed grid item). | 294 // It should be possible to not dirty the grid in some cases (like moving an
explicitly placed grid item). |
295 // For now, it's more simple to just always recompute the grid. | 295 // For now, it's more simple to just always recompute the grid. |
296 toRenderGrid(parent())->dirtyGrid(); | 296 toLayoutGrid(parent())->dirtyGrid(); |
297 } | 297 } |
298 | 298 |
299 void LayoutBox::updateFromStyle() | 299 void LayoutBox::updateFromStyle() |
300 { | 300 { |
301 LayoutBoxModelObject::updateFromStyle(); | 301 LayoutBoxModelObject::updateFromStyle(); |
302 | 302 |
303 const LayoutStyle& styleToUse = styleRef(); | 303 const LayoutStyle& styleToUse = styleRef(); |
304 bool isRootObject = isDocumentElement(); | 304 bool isRootObject = isDocumentElement(); |
305 bool isViewObject = isRenderView(); | 305 bool isViewObject = isRenderView(); |
306 bool rootLayerScrolls = document().settings() && document().settings()->root
LayerScrolls(); | 306 bool rootLayerScrolls = document().settings() && document().settings()->root
LayerScrolls(); |
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 containerWidthInInlineDirection = perpendicularContainingBlockLogica
lHeight(); | 1993 containerWidthInInlineDirection = perpendicularContainingBlockLogica
lHeight(); |
1994 LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize
, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb); | 1994 LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize
, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb); |
1995 computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth,
containerWidthInInlineDirection, cb); | 1995 computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth,
containerWidthInInlineDirection, cb); |
1996 } | 1996 } |
1997 | 1997 |
1998 // Margin calculations. | 1998 // Margin calculations. |
1999 computeMarginsForDirection(InlineDirection, cb, containerLogicalWidth, compu
tedValues.m_extent, computedValues.m_margins.m_start, | 1999 computeMarginsForDirection(InlineDirection, cb, containerLogicalWidth, compu
tedValues.m_extent, computedValues.m_margins.m_start, |
2000 computedValues.m_margins.m_end, style()->marginStart(), style()->marginE
nd()); | 2000 computedValues.m_margins.m_end, style()->marginStart(), style()->marginE
nd()); |
2001 | 2001 |
2002 if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLo
gicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + comp
utedValues.m_margins.m_end) | 2002 if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLo
gicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + comp
utedValues.m_margins.m_end) |
2003 && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated
() && !cb->isRenderGrid()) { | 2003 && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated
() && !cb->isLayoutGrid()) { |
2004 LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent -
cb->marginStartForChild(*this); | 2004 LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent -
cb->marginStartForChild(*this); |
2005 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != sty
le()->isLeftToRightDirection(); | 2005 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != sty
le()->isLeftToRightDirection(); |
2006 if (hasInvertedDirection) | 2006 if (hasInvertedDirection) |
2007 computedValues.m_margins.m_start = newMargin; | 2007 computedValues.m_margins.m_start = newMargin; |
2008 else | 2008 else |
2009 computedValues.m_margins.m_end = newMargin; | 2009 computedValues.m_margins.m_end = newMargin; |
2010 } | 2010 } |
2011 | 2011 |
2012 if (styleToUse.textAutosizingMultiplier() != 1 && styleToUse.marginStart().t
ype() == Fixed) { | 2012 if (styleToUse.textAutosizingMultiplier() != 1 && styleToUse.marginStart().t
ype() == Fixed) { |
2013 Node* parentNode = generatingNode(); | 2013 Node* parentNode = generatingNode(); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2288 // https://bugs.webkit.org/show_bug.cgi?id=46418 | 2288 // https://bugs.webkit.org/show_bug.cgi?id=46418 |
2289 bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->
style()->boxOrient() == HORIZONTAL; | 2289 bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->
style()->boxOrient() == HORIZONTAL; |
2290 bool stretching = parent()->style()->boxAlign() == BSTRETCH; | 2290 bool stretching = parent()->style()->boxAlign() == BSTRETCH; |
2291 bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBo
x || !stretching); | 2291 bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBo
x || !stretching); |
2292 bool checkMinMaxHeight = false; | 2292 bool checkMinMaxHeight = false; |
2293 | 2293 |
2294 // The parent box is flexing us, so it has increased or decreased our he
ight. We have to | 2294 // The parent box is flexing us, so it has increased or decreased our he
ight. We have to |
2295 // grab our cached flexible height. | 2295 // grab our cached flexible height. |
2296 // FIXME: Account for writing-mode in flexible boxes. | 2296 // FIXME: Account for writing-mode in flexible boxes. |
2297 // https://bugs.webkit.org/show_bug.cgi?id=46418 | 2297 // https://bugs.webkit.org/show_bug.cgi?id=46418 |
2298 if (hasOverrideHeight() && (parent()->isFlexibleBoxIncludingDeprecated()
|| parent()->isRenderGrid())) { | 2298 if (hasOverrideHeight() && (parent()->isFlexibleBoxIncludingDeprecated()
|| parent()->isLayoutGrid())) { |
2299 h = Length(overrideLogicalContentHeight(), Fixed); | 2299 h = Length(overrideLogicalContentHeight(), Fixed); |
2300 } else if (treatAsReplaced) { | 2300 } else if (treatAsReplaced) { |
2301 h = Length(computeReplacedLogicalHeight(), Fixed); | 2301 h = Length(computeReplacedLogicalHeight(), Fixed); |
2302 } else { | 2302 } else { |
2303 h = style()->logicalHeight(); | 2303 h = style()->logicalHeight(); |
2304 checkMinMaxHeight = true; | 2304 checkMinMaxHeight = true; |
2305 } | 2305 } |
2306 | 2306 |
2307 // Block children of horizontal flexible boxes fill the height of the bo
x. | 2307 // Block children of horizontal flexible boxes fill the height of the bo
x. |
2308 // FIXME: Account for writing-mode in flexible boxes. | 2308 // FIXME: Account for writing-mode in flexible boxes. |
(...skipping 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4627 } | 4627 } |
4628 | 4628 |
4629 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst | 4629 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst |
4630 { | 4630 { |
4631 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); | 4631 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); |
4632 if (LayerScrollableArea* area = scrollableArea()) | 4632 if (LayerScrollableArea* area = scrollableArea()) |
4633 displayItemList->invalidate(area->displayItemClient()); | 4633 displayItemList->invalidate(area->displayItemClient()); |
4634 } | 4634 } |
4635 | 4635 |
4636 } // namespace blink | 4636 } // namespace blink |
OLD | NEW |