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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Send over for review Created 4 years, 3 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 } 1556 }
1557 1557
1558 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() 1558 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange()
1559 { 1559 {
1560 bool neededRecalc = needsOverflowRecalcAfterStyleChange(); 1560 bool neededRecalc = needsOverflowRecalcAfterStyleChange();
1561 setSelfNeedsOverflowRecalcAfterStyleChange(); 1561 setSelfNeedsOverflowRecalcAfterStyleChange();
1562 if (!neededRecalc) 1562 if (!neededRecalc)
1563 markAncestorsForOverflowRecalcIfNeeded(); 1563 markAncestorsForOverflowRecalcIfNeeded();
1564 } 1564 }
1565 1565
1566 void LayoutObject::setStyleFromNodeOrElement(PassRefPtr<ComputedStyle> computedS tyle)
Bugs Nash 2016/09/16 01:45:04 method name should describe what it does, not wher
1567 {
1568 if (m_style->hasImage() || computedStyle->hasImage() || isImage() || isVideo ())
1569 setStyle(std::move(computedStyle));
1570 else
1571 setStyleInternal(std::move(computedStyle));
1572 }
1573
1566 DISABLE_CFI_PERF 1574 DISABLE_CFI_PERF
1567 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) 1575 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style)
1568 { 1576 {
1569 ASSERT(style); 1577 ASSERT(style);
1570 1578
1571 if (m_style == style) { 1579 if (m_style == style) {
1572 // We need to run through adjustStyleDifference() for iframes, plugins, and canvas so 1580 // We need to run through adjustStyleDifference() for iframes, plugins, and canvas so
1573 // style sharing is disabled for them. That should ensure that we never hit this code path. 1581 // style sharing is disabled for them. That should ensure that we never hit this code path.
1574 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas()); 1582 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas());
1575 return; 1583 return;
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
3275 const blink::LayoutObject* root = object1; 3283 const blink::LayoutObject* root = object1;
3276 while (root->parent()) 3284 while (root->parent())
3277 root = root->parent(); 3285 root = root->parent();
3278 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3286 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3279 } else { 3287 } else {
3280 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3288 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3281 } 3289 }
3282 } 3290 }
3283 3291
3284 #endif 3292 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698