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

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

Issue 2821193003: Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document. (Closed)
Patch Set: Revert back to rune@'s lgtmed patch Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.h » ('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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "platform/instrumentation/tracing/TraceEvent.h" 54 #include "platform/instrumentation/tracing/TraceEvent.h"
55 #include "platform/wtf/HashSet.h" 55 #include "platform/wtf/HashSet.h"
56 #include "platform/wtf/text/AtomicString.h" 56 #include "platform/wtf/text/AtomicString.h"
57 57
58 namespace blink { 58 namespace blink {
59 59
60 using namespace HTMLNames; 60 using namespace HTMLNames;
61 61
62 inline ComputedStyle* GetElementStyle(Element& element) { 62 inline ComputedStyle* GetElementStyle(Element& element) {
63 if (element.NeedsReattachLayoutTree()) { 63 if (element.NeedsReattachLayoutTree()) {
64 if (ComputedStyle* computed_style = 64 if (ComputedStyle* computed_style = element.GetNonAttachedStyle())
65 element.GetDocument().GetNonAttachedStyle(element))
66 return computed_style; 65 return computed_style;
67 } 66 }
68 return element.MutableComputedStyle(); 67 return element.MutableComputedStyle();
69 } 68 }
70 69
71 bool SharedStyleFinder::CanShareStyleWithControl(Element& candidate) const { 70 bool SharedStyleFinder::CanShareStyleWithControl(Element& candidate) const {
72 if (!isHTMLInputElement(candidate) || !isHTMLInputElement(GetElement())) 71 if (!isHTMLInputElement(candidate) || !isHTMLInputElement(GetElement()))
73 return false; 72 return false;
74 73
75 HTMLInputElement& candidate_input = toHTMLInputElement(candidate); 74 HTMLInputElement& candidate_input = toHTMLInputElement(candidate);
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 ->ChildrenSupportStyleSharing()) { 420 ->ChildrenSupportStyleSharing()) {
422 INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(), 421 INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(),
423 shared_style_rejected_by_parent, 1); 422 shared_style_rejected_by_parent, 1);
424 return nullptr; 423 return nullptr;
425 } 424 }
426 425
427 return GetElementStyle(*share_element); 426 return GetElementStyle(*share_element);
428 } 427 }
429 428
430 } // namespace blink 429 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698