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

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

Issue 994903003: Merge Element::offsetParentForBindings() into offsetParent() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 537 }
538 538
539 int Element::offsetHeight() 539 int Element::offsetHeight()
540 { 540 {
541 document().updateLayoutIgnorePendingStylesheets(); 541 document().updateLayoutIgnorePendingStylesheets();
542 if (LayoutBoxModelObject* renderer = layoutBoxModelObject()) 542 if (LayoutBoxModelObject* renderer = layoutBoxModelObject())
543 return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedOffsetHeigh t(), *renderer).round(); 543 return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedOffsetHeigh t(), *renderer).round();
544 return 0; 544 return 0;
545 } 545 }
546 546
547 Element* Element::offsetParentForBindings()
548 {
549 Element* element = offsetParent();
550 if (!element || !element->isInShadowTree())
551 return element;
552 return element->containingShadowRoot()->shouldExposeToBindings() ? element : nullptr;
553 }
554
555 Element* Element::offsetParent() 547 Element* Element::offsetParent()
556 { 548 {
557 document().updateLayoutIgnorePendingStylesheets(); 549 document().updateLayoutIgnorePendingStylesheets();
558 if (LayoutObject* renderer = this->layoutObject()) 550
559 return renderer->offsetParent(); 551 LayoutObject* renderer = layoutObject();
560 return nullptr; 552 if (!renderer)
553 return nullptr;
554
555 Element* element = renderer->offsetParent();
556 if (!element)
557 return nullptr;
558
559 if (element->isInShadowTree() && !element->containingShadowRoot()->shouldExp oseToBindings())
560 return nullptr;
561
562 return element;
561 } 563 }
562 564
563 int Element::clientLeft() 565 int Element::clientLeft()
564 { 566 {
565 document().updateLayoutIgnorePendingStylesheets(); 567 document().updateLayoutIgnorePendingStylesheets();
566 568
567 if (LayoutBox* renderer = layoutBox()) 569 if (LayoutBox* renderer = layoutBox())
568 return adjustLayoutUnitForAbsoluteZoom(roundToInt(renderer->clientLeft() ), *renderer); 570 return adjustLayoutUnitForAbsoluteZoom(roundToInt(renderer->clientLeft() ), *renderer);
569 return 0; 571 return 0;
570 } 572 }
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 { 3376 {
3375 #if ENABLE(OILPAN) 3377 #if ENABLE(OILPAN)
3376 if (hasRareData()) 3378 if (hasRareData())
3377 visitor->trace(elementRareData()); 3379 visitor->trace(elementRareData());
3378 visitor->trace(m_elementData); 3380 visitor->trace(m_elementData);
3379 #endif 3381 #endif
3380 ContainerNode::trace(visitor); 3382 ContainerNode::trace(visitor);
3381 } 3383 }
3382 3384
3383 } // namespace blink 3385 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698