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

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

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: [css-display] Support display: contents pseudo-elements. Created 3 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
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()->getCachedPseudoStyleOrCache(m_pseudoId);
101 m_pseudoId);
102 } 101 }
103 102
104 void PseudoElement::dispose() { 103 void PseudoElement::dispose() {
105 DCHECK(parentOrShadowHostElement()); 104 DCHECK(parentOrShadowHostElement());
106 105
107 InspectorInstrumentation::pseudoElementDestroyed(this); 106 InspectorInstrumentation::pseudoElementDestroyed(this);
108 107
109 DCHECK(!nextSibling()); 108 DCHECK(!nextSibling());
110 DCHECK(!previousSibling()); 109 DCHECK(!previousSibling());
111 110
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 LayoutObject* ancestor = layoutObject()->parent(); 188 LayoutObject* ancestor = layoutObject()->parent();
190 while (ancestor->isAnonymous() || 189 while (ancestor->isAnonymous() ||
191 (ancestor->node() && ancestor->node()->isPseudoElement())) { 190 (ancestor->node() && ancestor->node()->isPseudoElement())) {
192 DCHECK(ancestor->parent()); 191 DCHECK(ancestor->parent());
193 ancestor = ancestor->parent(); 192 ancestor = ancestor->parent();
194 } 193 }
195 return ancestor->node(); 194 return ancestor->node();
196 } 195 }
197 196
198 } // namespace blink 197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698