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

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

Issue 2774383002: Move getCached/getUncachedPseudoStyle to Element. (Closed)
Patch Set: Move getCached/getUncachedPseudoStyle to Element. Created 3 years, 8 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 parent->treeScope().adoptIfNeeded(*this); 90 parent->treeScope().adoptIfNeeded(*this);
91 setParentOrShadowHostNode(parent); 91 setParentOrShadowHostNode(parent);
92 setHasCustomStyleCallbacks(); 92 setHasCustomStyleCallbacks();
93 if ((pseudoId == PseudoIdBefore || pseudoId == PseudoIdAfter) && 93 if ((pseudoId == PseudoIdBefore || pseudoId == PseudoIdAfter) &&
94 parent->hasTagName(HTMLNames::inputTag)) 94 parent->hasTagName(HTMLNames::inputTag))
95 UseCounter::count(parent->document(), 95 UseCounter::count(parent->document(),
96 UseCounter::PseudoBeforeAfterForInputElement); 96 UseCounter::PseudoBeforeAfterForInputElement);
97 } 97 }
98 98
99 PassRefPtr<ComputedStyle> PseudoElement::customStyleForLayoutObject() { 99 PassRefPtr<ComputedStyle> PseudoElement::customStyleForLayoutObject() {
100 return parentOrShadowHostElement()->layoutObject()->getCachedPseudoStyle( 100 return parentOrShadowHostElement()->pseudoStyle(
101 m_pseudoId); 101 PseudoStyleRequest(m_pseudoId));
102 } 102 }
103 103
104 void PseudoElement::dispose() { 104 void PseudoElement::dispose() {
105 DCHECK(parentOrShadowHostElement()); 105 DCHECK(parentOrShadowHostElement());
106 106
107 probe::pseudoElementDestroyed(this); 107 probe::pseudoElementDestroyed(this);
108 108
109 DCHECK(!nextSibling()); 109 DCHECK(!nextSibling());
110 DCHECK(!previousSibling()); 110 DCHECK(!previousSibling());
111 111
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 LayoutObject* ancestor = layoutObject()->parent(); 189 LayoutObject* ancestor = layoutObject()->parent();
190 while (ancestor->isAnonymous() || 190 while (ancestor->isAnonymous() ||
191 (ancestor->node() && ancestor->node()->isPseudoElement())) { 191 (ancestor->node() && ancestor->node()->isPseudoElement())) {
192 DCHECK(ancestor->parent()); 192 DCHECK(ancestor->parent());
193 ancestor = ancestor->parent(); 193 ancestor = ancestor->parent();
194 } 194 }
195 return ancestor->node(); 195 return ancestor->node();
196 } 196 }
197 197
198 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698