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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 633 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
634 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight()), layoutObject->styleRef()).round(); | 634 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight()), layoutObject->styleRef()).round(); |
635 return 0; | 635 return 0; |
636 } | 636 } |
637 | 637 |
638 Element* Element::offsetParent() | 638 Element* Element::offsetParent() |
639 { | 639 { |
640 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 640 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
641 | 641 |
642 LayoutObject* layoutObject = this->layoutObject(); | 642 LayoutObject* layoutObject = this->layoutObject(); |
643 if (!layoutObject) | 643 return layoutObject ? layoutObject->offsetParentForBinding() : nullptr; |
644 return nullptr; | |
645 | |
646 Element* element = layoutObject->offsetParent(); | |
647 if (!element) | |
648 return nullptr; | |
649 | |
650 if (element->isInShadowTree() && !element->containingShadowRoot()->isOpenOrV
0()) | |
651 return nullptr; | |
652 | |
653 return element; | |
654 } | 644 } |
655 | 645 |
656 int Element::clientLeft() | 646 int Element::clientLeft() |
657 { | 647 { |
658 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 648 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
659 | 649 |
660 if (LayoutBox* layoutObject = layoutBox()) | 650 if (LayoutBox* layoutObject = layoutBox()) |
661 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou
tObject->styleRef()).round(); | 651 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou
tObject->styleRef()).round(); |
662 return 0; | 652 return 0; |
663 } | 653 } |
(...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3717 | 3707 |
3718 DEFINE_TRACE_WRAPPERS(Element) | 3708 DEFINE_TRACE_WRAPPERS(Element) |
3719 { | 3709 { |
3720 if (hasRareData()) { | 3710 if (hasRareData()) { |
3721 visitor->traceWrappers(elementRareData()); | 3711 visitor->traceWrappers(elementRareData()); |
3722 } | 3712 } |
3723 ContainerNode::traceWrappers(visitor); | 3713 ContainerNode::traceWrappers(visitor); |
3724 } | 3714 } |
3725 | 3715 |
3726 } // namespace blink | 3716 } // namespace blink |
OLD | NEW |