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

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

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 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) 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 String PseudoElement::pseudoElementNameForEvents(PseudoId pseudoId) { 71 String PseudoElement::pseudoElementNameForEvents(PseudoId pseudoId) {
72 DEFINE_STATIC_LOCAL(const String, after, ("::after")); 72 DEFINE_STATIC_LOCAL(const String, after, ("::after"));
73 DEFINE_STATIC_LOCAL(const String, before, ("::before")); 73 DEFINE_STATIC_LOCAL(const String, before, ("::before"));
74 switch (pseudoId) { 74 switch (pseudoId) {
75 case PseudoIdAfter: 75 case PseudoIdAfter:
76 return after; 76 return after;
77 case PseudoIdBefore: 77 case PseudoIdBefore:
78 return before; 78 return before;
79 default: 79 default:
80 return emptyString(); 80 return emptyString;
81 } 81 }
82 } 82 }
83 83
84 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId) 84 PseudoElement::PseudoElement(Element* parent, PseudoId pseudoId)
85 : Element(pseudoElementTagName(pseudoId), 85 : Element(pseudoElementTagName(pseudoId),
86 &parent->document(), 86 &parent->document(),
87 CreateElement), 87 CreateElement),
88 m_pseudoId(pseudoId) { 88 m_pseudoId(pseudoId) {
89 DCHECK_NE(pseudoId, PseudoIdNone); 89 DCHECK_NE(pseudoId, PseudoIdNone);
90 parent->treeScope().adoptIfNeeded(*this); 90 parent->treeScope().adoptIfNeeded(*this);
(...skipping 98 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/IconURL.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698