| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 if (!callback) { | 595 if (!callback) { |
| 596 nativeApplyScroll(scrollState); | 596 nativeApplyScroll(scrollState); |
| 597 return; | 597 return; |
| 598 } | 598 } |
| 599 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 599 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
| 600 callback->handleEvent(&scrollState); | 600 callback->handleEvent(&scrollState); |
| 601 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) | 601 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati
veScroll) |
| 602 nativeApplyScroll(scrollState); | 602 nativeApplyScroll(scrollState); |
| 603 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) | 603 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte
rNativeScroll) |
| 604 callback->handleEvent(&scrollState); | 604 callback->handleEvent(&scrollState); |
| 605 }; | 605 } |
| 606 | 606 |
| 607 int Element::offsetLeft() | 607 int Element::offsetLeft() |
| 608 { | 608 { |
| 609 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 609 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 610 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 610 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 611 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetLeft()), layoutObject->styleRef()).round(); | 611 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetLeft(offsetParent())), layoutObject->styleRef()).round(); |
| 612 return 0; | 612 return 0; |
| 613 } | 613 } |
| 614 | 614 |
| 615 int Element::offsetTop() | 615 int Element::offsetTop() |
| 616 { | 616 { |
| 617 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 617 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 618 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 618 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 619 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetTop()), layoutObject->styleRef()).round(); | 619 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetTop(offsetParent())), layoutObject->styleRef()).round(); |
| 620 return 0; | 620 return 0; |
| 621 } | 621 } |
| 622 | 622 |
| 623 int Element::offsetWidth() | 623 int Element::offsetWidth() |
| 624 { | 624 { |
| 625 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 625 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 626 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 626 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 627 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetWidth()), layoutObject->styleRef()).round(); | 627 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetWidth(offsetParent())), layoutObject->styleRef()).round(); |
| 628 return 0; | 628 return 0; |
| 629 } | 629 } |
| 630 | 630 |
| 631 int Element::offsetHeight() | 631 int Element::offsetHeight() |
| 632 { | 632 { |
| 633 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 633 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 634 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) | 634 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) |
| 635 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight()), layoutObject->styleRef()).round(); | 635 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna
ppedOffsetHeight(offsetParent())), layoutObject->styleRef()).round(); |
| 636 return 0; | 636 return 0; |
| 637 } | 637 } |
| 638 | 638 |
| 639 Element* Element::offsetParent() | 639 Element* Element::offsetParent() |
| 640 { | 640 { |
| 641 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 641 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 642 | 642 |
| 643 LayoutObject* layoutObject = this->layoutObject(); | 643 LayoutObject* layoutObject = this->layoutObject(); |
| 644 if (!layoutObject) | 644 return layoutObject ? layoutObject->offsetParent() : nullptr; |
| 645 return nullptr; | |
| 646 | |
| 647 Element* element = layoutObject->offsetParent(); | |
| 648 if (!element) | |
| 649 return nullptr; | |
| 650 | |
| 651 if (element->isInShadowTree() && !element->containingShadowRoot()->isOpenOrV
0()) | |
| 652 return nullptr; | |
| 653 | |
| 654 return element; | |
| 655 } | 645 } |
| 656 | 646 |
| 657 int Element::clientLeft() | 647 int Element::clientLeft() |
| 658 { | 648 { |
| 659 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 649 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 660 | 650 |
| 661 if (LayoutBox* layoutObject = layoutBox()) | 651 if (LayoutBox* layoutObject = layoutBox()) |
| 662 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou
tObject->styleRef()).round(); | 652 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou
tObject->styleRef()).round(); |
| 663 return 0; | 653 return 0; |
| 664 } | 654 } |
| (...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3722 | 3712 |
| 3723 DEFINE_TRACE_WRAPPERS(Element) | 3713 DEFINE_TRACE_WRAPPERS(Element) |
| 3724 { | 3714 { |
| 3725 if (hasRareData()) { | 3715 if (hasRareData()) { |
| 3726 visitor->traceWrappers(elementRareData()); | 3716 visitor->traceWrappers(elementRareData()); |
| 3727 } | 3717 } |
| 3728 ContainerNode::traceWrappers(visitor); | 3718 ContainerNode::traceWrappers(visitor); |
| 3729 } | 3719 } |
| 3730 | 3720 |
| 3731 } // namespace blink | 3721 } // namespace blink |
| OLD | NEW |