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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 return; | 1488 return; |
1489 | 1489 |
1490 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | 1490 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { |
1491 rect.move(paintInvalidationState->paintOffset()); | 1491 rect.move(paintInvalidationState->paintOffset()); |
1492 if (paintInvalidationState->isClipped()) | 1492 if (paintInvalidationState->isClipped()) |
1493 rect.intersect(paintInvalidationState->clipRect()); | 1493 rect.intersect(paintInvalidationState->clipRect()); |
1494 return; | 1494 return; |
1495 } | 1495 } |
1496 | 1496 |
1497 if (LayoutObject* o = parent()) { | 1497 if (LayoutObject* o = parent()) { |
1498 if (o->isLayoutBlockFlow()) { | |
1499 LayoutBlock* cb = toLayoutBlock(o); | |
1500 if (cb->hasColumns()) | |
1501 cb->adjustRectForColumns(rect); | |
1502 } | |
1503 | |
1504 if (o->hasOverflowClip()) { | 1498 if (o->hasOverflowClip()) { |
1505 LayoutBox* boxParent = toLayoutBox(o); | 1499 LayoutBox* boxParent = toLayoutBox(o); |
1506 boxParent->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); | 1500 boxParent->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); |
1507 if (rect.isEmpty()) | 1501 if (rect.isEmpty()) |
1508 return; | 1502 return; |
1509 } | 1503 } |
1510 | 1504 |
1511 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, p
aintInvalidationState); | 1505 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, p
aintInvalidationState); |
1512 } | 1506 } |
1513 } | 1507 } |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO) | 1958 if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO) |
1965 continue; | 1959 continue; |
1966 | 1960 |
1967 if (blockChildrenOnly && !child->isLayoutBlock()) | 1961 if (blockChildrenOnly && !child->isLayoutBlock()) |
1968 continue; | 1962 continue; |
1969 | 1963 |
1970 if (child->isLayoutFullScreen() || child->isLayoutFullScreenPlaceholder(
)) | 1964 if (child->isLayoutFullScreen() || child->isLayoutFullScreenPlaceholder(
)) |
1971 continue; | 1965 continue; |
1972 | 1966 |
1973 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWith
Display(styleRef(), child->style()->display()); | 1967 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWith
Display(styleRef(), child->style()->display()); |
1974 if (!RuntimeEnabledFeatures::regionBasedColumnsEnabled()) { | |
1975 if (style()->specifiesColumns()) { | |
1976 if (child->style()->specifiesColumns()) | |
1977 newStyle->inheritColumnPropertiesFrom(styleRef()); | |
1978 if (child->style()->columnSpan()) | |
1979 newStyle->setColumnSpan(ColumnSpanAll); | |
1980 } | |
1981 } | |
1982 | 1968 |
1983 // Preserve the position style of anonymous block continuations as they
can have relative position when | 1969 // Preserve the position style of anonymous block continuations as they
can have relative position when |
1984 // they contain block descendants of relative positioned inlines. | 1970 // they contain block descendants of relative positioned inlines. |
1985 if (child->isRelPositioned() && toLayoutBlock(child)->isAnonymousBlockCo
ntinuation()) | 1971 if (child->isRelPositioned() && toLayoutBlock(child)->isAnonymousBlockCo
ntinuation()) |
1986 newStyle->setPosition(child->style()->position()); | 1972 newStyle->setPosition(child->style()->position()); |
1987 | 1973 |
1988 updateAnonymousChildStyle(*child, *newStyle); | 1974 updateAnonymousChildStyle(*child, *newStyle); |
1989 | 1975 |
1990 child->setStyle(newStyle.release()); | 1976 child->setStyle(newStyle.release()); |
1991 } | 1977 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 return; | 2048 return; |
2063 | 2049 |
2064 LayoutObject* o = parent(); | 2050 LayoutObject* o = parent(); |
2065 if (!o) | 2051 if (!o) |
2066 return; | 2052 return; |
2067 | 2053 |
2068 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. | 2054 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. |
2069 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); | 2055 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); |
2070 if (mode & ApplyContainerFlip && o->isBox()) { | 2056 if (mode & ApplyContainerFlip && o->isBox()) { |
2071 if (o->style()->isFlippedBlocksWritingMode()) | 2057 if (o->style()->isFlippedBlocksWritingMode()) |
2072 transformState.move(toLayoutBox(o)->flipForWritingModeIncludingColum
ns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); | 2058 transformState.move(toLayoutBox(o)->flipForWritingMode(roundedLayout
Point(transformState.mappedPoint())) - centerPoint); |
2073 mode &= ~ApplyContainerFlip; | 2059 mode &= ~ApplyContainerFlip; |
2074 } | 2060 } |
2075 | 2061 |
2076 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); | 2062 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); |
2077 | 2063 |
2078 if (o->hasOverflowClip()) | 2064 if (o->hasOverflowClip()) |
2079 transformState.move(-toLayoutBox(o)->scrolledContentOffset()); | 2065 transformState.move(-toLayoutBox(o)->scrolledContentOffset()); |
2080 | 2066 |
2081 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed, paintInvalidationState); | 2067 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed, paintInvalidationState); |
2082 } | 2068 } |
2083 | 2069 |
2084 const LayoutObject* LayoutObject::pushMappingToContainer(const LayoutBoxModelObj
ect* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 2070 const LayoutObject* LayoutObject::pushMappingToContainer(const LayoutBoxModelObj
ect* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
2085 { | 2071 { |
2086 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); | 2072 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); |
2087 | 2073 |
2088 LayoutObject* container = parent(); | 2074 LayoutObject* container = parent(); |
2089 if (!container) | 2075 if (!container) |
2090 return 0; | 2076 return 0; |
2091 | 2077 |
2092 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. | 2078 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. |
2093 LayoutSize offset; | 2079 LayoutSize offset; |
2094 if (container->hasOverflowClip()) | 2080 if (container->hasOverflowClip()) |
2095 offset = -LayoutSize(toLayoutBox(container)->scrolledContentOffset()); | 2081 offset = -LayoutSize(toLayoutBox(container)->scrolledContentOffset()); |
2096 | 2082 |
2097 geometryMap.push(this, offset, hasColumns()); | 2083 geometryMap.push(this, offset); |
2098 | 2084 |
2099 return container; | 2085 return container; |
2100 } | 2086 } |
2101 | 2087 |
2102 void LayoutObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformSt
ate& transformState) const | 2088 void LayoutObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformSt
ate& transformState) const |
2103 { | 2089 { |
2104 LayoutObject* o = parent(); | 2090 LayoutObject* o = parent(); |
2105 if (o) { | 2091 if (o) { |
2106 o->mapAbsoluteToLocalPoint(mode, transformState); | 2092 o->mapAbsoluteToLocalPoint(mode, transformState); |
2107 if (o->hasOverflowClip()) | 2093 if (o->hasOverflowClip()) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const | 2166 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const |
2181 { | 2167 { |
2182 ASSERT(o == container()); | 2168 ASSERT(o == container()); |
2183 | 2169 |
2184 LayoutSize offset = o->columnOffset(point); | 2170 LayoutSize offset = o->columnOffset(point); |
2185 | 2171 |
2186 if (o->hasOverflowClip()) | 2172 if (o->hasOverflowClip()) |
2187 offset -= toLayoutBox(o)->scrolledContentOffset(); | 2173 offset -= toLayoutBox(o)->scrolledContentOffset(); |
2188 | 2174 |
2189 if (offsetDependsOnPoint) | 2175 if (offsetDependsOnPoint) |
2190 *offsetDependsOnPoint = hasColumns() || o->isLayoutFlowThread(); | 2176 *offsetDependsOnPoint = o->isLayoutFlowThread(); |
2191 | 2177 |
2192 return offset; | 2178 return offset; |
2193 } | 2179 } |
2194 | 2180 |
2195 LayoutSize LayoutObject::offsetFromAncestorContainer(const LayoutObject* contain
er) const | 2181 LayoutSize LayoutObject::offsetFromAncestorContainer(const LayoutObject* contain
er) const |
2196 { | 2182 { |
2197 if (container == this) | 2183 if (container == this) |
2198 return LayoutSize(); | 2184 return LayoutSize(); |
2199 | 2185 |
2200 LayoutSize offset; | 2186 LayoutSize offset; |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3305 const blink::LayoutObject* root = object1; | 3291 const blink::LayoutObject* root = object1; |
3306 while (root->parent()) | 3292 while (root->parent()) |
3307 root = root->parent(); | 3293 root = root->parent(); |
3308 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3294 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3309 } else { | 3295 } else { |
3310 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3296 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3311 } | 3297 } |
3312 } | 3298 } |
3313 | 3299 |
3314 #endif | 3300 #endif |
OLD | NEW |