Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2197653002: CL for perf try job on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 if (!callback || disableCustomCallbacks) { 615 if (!callback || disableCustomCallbacks) {
616 nativeApplyScroll(scrollState); 616 nativeApplyScroll(scrollState);
617 return; 617 return;
618 } 618 }
619 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll) 619 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::PerformAfte rNativeScroll)
620 callback->handleEvent(&scrollState); 620 callback->handleEvent(&scrollState);
621 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll) 621 if (callback->nativeScrollBehavior() != WebNativeScrollBehavior::DisableNati veScroll)
622 nativeApplyScroll(scrollState); 622 nativeApplyScroll(scrollState);
623 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll) 623 if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfte rNativeScroll)
624 callback->handleEvent(&scrollState); 624 callback->handleEvent(&scrollState);
625 } 625 };
626 626
627 int Element::offsetLeft() 627 int Element::offsetLeft()
628 { 628 {
629 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 629 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
630 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) 630 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
631 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetLeft(offsetParent())), layoutObject->styleRef()).round(); 631 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetLeft()), layoutObject->styleRef()).round();
632 return 0; 632 return 0;
633 } 633 }
634 634
635 int Element::offsetTop() 635 int Element::offsetTop()
636 { 636 {
637 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 637 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
638 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) 638 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
639 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetTop(offsetParent())), layoutObject->styleRef()).round(); 639 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetTop()), layoutObject->styleRef()).round();
640 return 0; 640 return 0;
641 } 641 }
642 642
643 int Element::offsetWidth() 643 int Element::offsetWidth()
644 { 644 {
645 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 645 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
646 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) 646 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
647 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetWidth(offsetParent())), layoutObject->styleRef()).round(); 647 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetWidth()), layoutObject->styleRef()).round();
648 return 0; 648 return 0;
649 } 649 }
650 650
651 int Element::offsetHeight() 651 int Element::offsetHeight()
652 { 652 {
653 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 653 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
654 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject()) 654 if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
655 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetHeight(offsetParent())), layoutObject->styleRef()).round(); 655 return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSna ppedOffsetHeight()), layoutObject->styleRef()).round();
656 return 0; 656 return 0;
657 } 657 }
658 658
659 Element* Element::offsetParent() 659 Element* Element::offsetParent()
660 { 660 {
661 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 661 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
662 662
663 LayoutObject* layoutObject = this->layoutObject(); 663 LayoutObject* layoutObject = this->layoutObject();
664 return layoutObject ? layoutObject->offsetParent() : nullptr; 664 if (!layoutObject)
665 return nullptr;
666
667 Element* element = layoutObject->offsetParent();
668 if (!element)
669 return nullptr;
670
671 if (element->isInShadowTree() && !element->containingShadowRoot()->isOpenOrV 0())
672 return nullptr;
673
674 return element;
665 } 675 }
666 676
667 int Element::clientLeft() 677 int Element::clientLeft()
668 { 678 {
669 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 679 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
670 680
671 if (LayoutBox* layoutObject = layoutBox()) 681 if (LayoutBox* layoutObject = layoutBox())
672 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou tObject->styleRef()).round(); 682 return adjustLayoutUnitForAbsoluteZoom(layoutObject->clientLeft(), layou tObject->styleRef()).round();
673 return 0; 683 return 0;
674 } 684 }
(...skipping 3094 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 3779
3770 DEFINE_TRACE_WRAPPERS(Element) 3780 DEFINE_TRACE_WRAPPERS(Element)
3771 { 3781 {
3772 if (hasRareData()) { 3782 if (hasRareData()) {
3773 visitor->traceWrappers(elementRareData()); 3783 visitor->traceWrappers(elementRareData());
3774 } 3784 }
3775 ContainerNode::traceWrappers(visitor); 3785 ContainerNode::traceWrappers(visitor);
3776 } 3786 }
3777 3787
3778 } // namespace blink 3788 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698