| 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 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3047 } | 3047 } |
| 3048 | 3048 |
| 3049 return rect; | 3049 return rect; |
| 3050 } | 3050 } |
| 3051 | 3051 |
| 3052 PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point) | 3052 PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point) |
| 3053 { | 3053 { |
| 3054 // no children...return this render object's element, if there is one, and o
ffset 0 | 3054 // no children...return this render object's element, if there is one, and o
ffset 0 |
| 3055 RenderObject* firstChild = slowFirstChild(); | 3055 RenderObject* firstChild = slowFirstChild(); |
| 3056 if (!firstChild) | 3056 if (!firstChild) |
| 3057 return createPositionWithAffinity(nonPseudoNode() ? firstPositionInOrBef
oreNode(nonPseudoNode()) : Position()); | 3057 return createPositionWithAffinity(node() ? firstPositionInOrBeforeNode(n
ode()) : Position()); |
| 3058 | 3058 |
| 3059 // Pass off to the closest child. | 3059 // Pass off to the closest child. |
| 3060 LayoutUnit minDist = LayoutUnit::max(); | 3060 LayoutUnit minDist = LayoutUnit::max(); |
| 3061 RenderBox* closestRenderer = 0; | 3061 RenderBox* closestRenderer = 0; |
| 3062 LayoutPoint adjustedPoint = point; | 3062 LayoutPoint adjustedPoint = point; |
| 3063 | 3063 |
| 3064 for (RenderObject* renderObject = firstChild; renderObject; renderObject = r
enderObject->nextSibling()) { | 3064 for (RenderObject* renderObject = firstChild; renderObject; renderObject = r
enderObject->nextSibling()) { |
| 3065 if (!renderObject->slowFirstChild() && !renderObject->isInline() && !ren
derObject->isRenderBlockFlow()) | 3065 if (!renderObject->slowFirstChild() && !renderObject->isInline() && !ren
derObject->isRenderBlockFlow()) |
| 3066 continue; | 3066 continue; |
| 3067 | 3067 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3106 | 3106 |
| 3107 LayoutUnit dist = difference.width() * difference.width() + difference.h
eight() * difference.height(); | 3107 LayoutUnit dist = difference.width() * difference.width() + difference.h
eight() * difference.height(); |
| 3108 if (dist < minDist) { | 3108 if (dist < minDist) { |
| 3109 closestRenderer = renderer; | 3109 closestRenderer = renderer; |
| 3110 minDist = dist; | 3110 minDist = dist; |
| 3111 } | 3111 } |
| 3112 } | 3112 } |
| 3113 | 3113 |
| 3114 if (closestRenderer) | 3114 if (closestRenderer) |
| 3115 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer
->locationOffset()); | 3115 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer
->locationOffset()); |
| 3116 return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode(
))); | 3116 return createPositionWithAffinity(firstPositionInOrBeforeNode(node())); |
| 3117 } | 3117 } |
| 3118 | 3118 |
| 3119 InvalidationReason RenderBox::getPaintInvalidationReason(const RenderLayerModelO
bject& paintInvalidationContainer, | 3119 InvalidationReason RenderBox::getPaintInvalidationReason(const RenderLayerModelO
bject& paintInvalidationContainer, |
| 3120 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) | 3120 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) |
| 3121 { | 3121 { |
| 3122 InvalidationReason invalidationReason = RenderBoxModelObject::getPaintInvali
dationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newL
ocation); | 3122 InvalidationReason invalidationReason = RenderBoxModelObject::getPaintInvali
dationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newL
ocation); |
| 3123 if (invalidationReason != InvalidationNone && invalidationReason != Invalida
tionIncremental) | 3123 if (invalidationReason != InvalidationNone && invalidationReason != Invalida
tionIncremental) |
| 3124 return invalidationReason; | 3124 return invalidationReason; |
| 3125 | 3125 |
| 3126 if (!style()->hasBackground() && !style()->hasBoxDecorations()) | 3126 if (!style()->hasBackground() && !style()->hasBoxDecorations()) |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3511 | 3511 |
| 3512 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3512 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3513 { | 3513 { |
| 3514 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3514 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3515 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3515 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3516 ASSERT(hasBackground == style.hasBackground()); | 3516 ASSERT(hasBackground == style.hasBackground()); |
| 3517 hasBorder = style.hasBorder(); | 3517 hasBorder = style.hasBorder(); |
| 3518 } | 3518 } |
| 3519 | 3519 |
| 3520 } // namespace blink | 3520 } // namespace blink |
| OLD | NEW |