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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 1649983003: Remove the forced layout in getComputedStyle for elements in Shadow DOM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Look at ShadowRoots when walking up the tree in updateLayoutTreeForNodeIfNeeded. Created 4 years, 10 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. 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 Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 document.updateLayoutTreeForNodeIfNeeded(styledNode); 558 document.updateLayoutTreeForNodeIfNeeded(styledNode);
559 559
560 // The style recalc could have caused the styled node to be discarded or rep laced 560 // The style recalc could have caused the styled node to be discarded or rep laced
561 // if it was a PseudoElement so we need to update it. 561 // if it was a PseudoElement so we need to update it.
562 styledNode = this->styledNode(); 562 styledNode = this->styledNode();
563 layoutObject = styledNode->layoutObject(); 563 layoutObject = styledNode->layoutObject();
564 564
565 style = computeComputedStyle(); 565 style = computeComputedStyle();
566 566
567 bool forceFullLayout = isLayoutDependent(propertyID, style, layoutObject) 567 bool forceFullLayout = isLayoutDependent(propertyID, style, layoutObject)
568 || styledNode->isInShadowTree()
569 || (document.ownerElement() && document.ensureStyleResolver().hasViewpor tDependentMediaQueries()); 568 || (document.ownerElement() && document.ensureStyleResolver().hasViewpor tDependentMediaQueries());
570 569
571 if (forceFullLayout) { 570 if (forceFullLayout) {
572 document.updateLayoutIgnorePendingStylesheets(); 571 document.updateLayoutIgnorePendingStylesheets();
573 styledNode = this->styledNode(); 572 styledNode = this->styledNode();
574 style = computeComputedStyle(); 573 style = computeComputedStyle();
575 layoutObject = styledNode->layoutObject(); 574 layoutObject = styledNode->layoutObject();
576 } 575 }
577 576
578 if (!style) 577 if (!style)
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only."); 705 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only.");
707 } 706 }
708 707
709 DEFINE_TRACE(CSSComputedStyleDeclaration) 708 DEFINE_TRACE(CSSComputedStyleDeclaration)
710 { 709 {
711 visitor->trace(m_node); 710 visitor->trace(m_node);
712 CSSStyleDeclaration::trace(visitor); 711 CSSStyleDeclaration::trace(visitor);
713 } 712 }
714 713
715 } // namespace blink 714 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698