| 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 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 afterLowest = lowestDirtyLine; | 1987 afterLowest = lowestDirtyLine; |
| 1988 lowestDirtyLine = lowestDirtyLine->prevRootBox(); | 1988 lowestDirtyLine = lowestDirtyLine->prevRootBox(); |
| 1989 } | 1989 } |
| 1990 | 1990 |
| 1991 while (afterLowest && afterLowest != highest && (afterLowest->lineBottomWith
Leading() >= logicalTop || afterLowest->lineBottomWithLeading() < 0)) { | 1991 while (afterLowest && afterLowest != highest && (afterLowest->lineBottomWith
Leading() >= logicalTop || afterLowest->lineBottomWithLeading() < 0)) { |
| 1992 afterLowest->markDirty(); | 1992 afterLowest->markDirty(); |
| 1993 afterLowest = afterLowest->prevRootBox(); | 1993 afterLowest = afterLowest->prevRootBox(); |
| 1994 } | 1994 } |
| 1995 } | 1995 } |
| 1996 | 1996 |
| 1997 bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPo
int& locationInContainer, const LayoutPoint& accumulatedOffset) | |
| 1998 { | |
| 1999 if (!scrollsOverflow()) | |
| 2000 return false; | |
| 2001 | |
| 2002 return layer()->scrollableArea()->hitTestOverflowControls(result, roundedInt
Point(locationInContainer - toLayoutSize(accumulatedOffset))); | |
| 2003 } | |
| 2004 | |
| 2005 Node* RenderBlock::nodeForHitTest() const | 1997 Node* RenderBlock::nodeForHitTest() const |
| 2006 { | 1998 { |
| 2007 // If we are in the margins of block elements that are part of a | 1999 // If we are in the margins of block elements that are part of a |
| 2008 // continuation we're actually still inside the enclosing element | 2000 // continuation we're actually still inside the enclosing element |
| 2009 // that was split. Use the appropriate inner node. | 2001 // that was split. Use the appropriate inner node. |
| 2010 return isAnonymousBlockContinuation() ? continuation()->node() : node(); | 2002 return isAnonymousBlockContinuation() ? continuation()->node() : node(); |
| 2011 } | 2003 } |
| 2012 | 2004 |
| 2013 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, HitTestAction hitTestAction) | 2005 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, HitTestAction hitTestAction) |
| 2014 { | 2006 { |
| 2015 LayoutPoint adjustedLocation(accumulatedOffset + location()); | 2007 LayoutPoint adjustedLocation(accumulatedOffset + location()); |
| 2016 LayoutSize localOffset = toLayoutSize(adjustedLocation); | 2008 LayoutSize localOffset = toLayoutSize(adjustedLocation); |
| 2017 | 2009 |
| 2018 if (!isRenderView()) { | 2010 if (!isRenderView()) { |
| 2019 // Check if we need to do anything at all. | 2011 // Check if we need to do anything at all. |
| 2020 // If we have clipping, then we can't have any spillout. | 2012 // If we have clipping, then we can't have any spillout. |
| 2021 LayoutRect overflowBox = hasOverflowClip() ? borderBoxRect() : visualOve
rflowRect(); | 2013 LayoutRect overflowBox = hasOverflowClip() ? borderBoxRect() : visualOve
rflowRect(); |
| 2022 overflowBox.moveBy(adjustedLocation); | 2014 overflowBox.moveBy(adjustedLocation); |
| 2023 if (!locationInContainer.intersects(overflowBox)) | 2015 if (!locationInContainer.intersects(overflowBox)) |
| 2024 return false; | 2016 return false; |
| 2025 } | 2017 } |
| 2026 | 2018 |
| 2027 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil
dBlockBackground) | |
| 2028 && visibleToHitTestRequest(request) | |
| 2029 && isPointInOverflowControl(result, locationInContainer.point(), adjuste
dLocation)) { | |
| 2030 updateHitTestResult(result, locationInContainer.point() - localOffset); | |
| 2031 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet
. | |
| 2032 if (!result.addNodeToRectBasedTestResult(nodeForHitTest(), request, loca
tionInContainer)) | |
| 2033 return true; | |
| 2034 } | |
| 2035 | |
| 2036 if (style()->clipPath()) { | 2019 if (style()->clipPath()) { |
| 2037 switch (style()->clipPath()->type()) { | 2020 switch (style()->clipPath()->type()) { |
| 2038 case ClipPathOperation::SHAPE: { | 2021 case ClipPathOperation::SHAPE: { |
| 2039 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()-
>clipPath()); | 2022 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(style()-
>clipPath()); |
| 2040 // FIXME: handle marginBox etc. | 2023 // FIXME: handle marginBox etc. |
| 2041 if (!clipPath->path(borderBoxRect()).contains(locationInContainer.po
int() - localOffset, clipPath->windRule())) | 2024 if (!clipPath->path(borderBoxRect()).contains(locationInContainer.po
int() - localOffset, clipPath->windRule())) |
| 2042 return false; | 2025 return false; |
| 2043 break; | 2026 break; |
| 2044 } | 2027 } |
| 2045 case ClipPathOperation::REFERENCE: | 2028 case ClipPathOperation::REFERENCE: |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2960 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 2943 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 2961 { | 2944 { |
| 2962 showRenderObject(); | 2945 showRenderObject(); |
| 2963 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2946 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 2964 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2947 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 2965 } | 2948 } |
| 2966 | 2949 |
| 2967 #endif | 2950 #endif |
| 2968 | 2951 |
| 2969 } // namespace blink | 2952 } // namespace blink |
| OLD | NEW |