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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 17654008: Implement the ::backdrop pseudo-element for modal <dialog>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add helper function and descendant selector test Created 7 years, 5 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 | Annotate | Revision Log
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) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 198 }
199 #endif 199 #endif
200 200
201 if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper() ) 201 if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper() )
202 cssomWrapper->clearParentElement(); 202 cssomWrapper->clearParentElement();
203 203
204 if (hasRareData()) { 204 if (hasRareData()) {
205 ElementRareData* data = elementRareData(); 205 ElementRareData* data = elementRareData();
206 data->setPseudoElement(BEFORE, 0); 206 data->setPseudoElement(BEFORE, 0);
207 data->setPseudoElement(AFTER, 0); 207 data->setPseudoElement(AFTER, 0);
208 data->setPseudoElement(BACKDROP, 0);
208 data->clearShadow(); 209 data->clearShadow();
209 } 210 }
210 211
211 if (isCustomElement() && document() && document()->registry()) { 212 if (isCustomElement() && document() && document()->registry()) {
212 document()->registry()->customElementWasDestroyed(this); 213 document()->registry()->customElementWasDestroyed(this);
213 } 214 }
214 215
215 if (hasSyntheticAttrChildNodes()) 216 if (hasSyntheticAttrChildNodes())
216 detachAllAttrNodesFromElement(); 217 detachAllAttrNodesFromElement();
217 218
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 // When a shadow root exists, it does the work of attaching the children. 1344 // When a shadow root exists, it does the work of attaching the children.
1344 if (ElementShadow* shadow = this->shadow()) { 1345 if (ElementShadow* shadow = this->shadow()) {
1345 parentPusher.push(); 1346 parentPusher.push();
1346 shadow->attach(context); 1347 shadow->attach(context);
1347 } else if (firstChild()) 1348 } else if (firstChild())
1348 parentPusher.push(); 1349 parentPusher.push();
1349 1350
1350 ContainerNode::attach(context); 1351 ContainerNode::attach(context);
1351 1352
1352 createPseudoElementIfNeeded(AFTER); 1353 createPseudoElementIfNeeded(AFTER);
1354 createPseudoElementIfNeeded(BACKDROP);
1353 1355
1354 if (hasRareData()) { 1356 if (hasRareData()) {
1355 ElementRareData* data = elementRareData(); 1357 ElementRareData* data = elementRareData();
1356 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) { 1358 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) {
1357 if (isFocusable() && document()->focusedNode() == this) 1359 if (isFocusable() && document()->focusedNode() == this)
1358 document()->updateFocusAppearanceSoon(false /* don't restore sel ection */); 1360 document()->updateFocusAppearanceSoon(false /* don't restore sel ection */);
1359 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false); 1361 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false);
1360 } 1362 }
1361 } 1363 }
1362 1364
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 // when RenderObject::isChildAllowed on our parent returns false for the 2418 // when RenderObject::isChildAllowed on our parent returns false for the
2417 // PseudoElement's renderer for each style recalc. 2419 // PseudoElement's renderer for each style recalc.
2418 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP seudoStyle(pseudoId))) 2420 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP seudoStyle(pseudoId)))
2419 elementRareData()->setPseudoElement(pseudoId, 0); 2421 elementRareData()->setPseudoElement(pseudoId, 0);
2420 } else if (change >= Inherit || needsStyleRecalc()) 2422 } else if (change >= Inherit || needsStyleRecalc())
2421 createPseudoElementIfNeeded(pseudoId); 2423 createPseudoElementIfNeeded(pseudoId);
2422 } 2424 }
2423 2425
2424 void Element::createPseudoElementIfNeeded(PseudoId pseudoId) 2426 void Element::createPseudoElementIfNeeded(PseudoId pseudoId)
2425 { 2427 {
2426 if (!document()->styleSheetCollection()->usesBeforeAfterRules()) 2428 if ((pseudoId == BEFORE || pseudoId == AFTER) && !document()->styleSheetColl ection()->usesBeforeAfterRules())
2429 return;
2430
2431 if (pseudoId == BACKDROP && !isInTopLayer())
2427 return; 2432 return;
2428 2433
2429 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud oStyle(pseudoId))) 2434 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud oStyle(pseudoId)))
2430 return; 2435 return;
2431 2436
2432 if (!renderer()->canHaveGeneratedChildren()) 2437 if (!renderer()->canHaveGeneratedChildren())
2433 return; 2438 return;
2434 2439
2435 ASSERT(!isPseudoElement()); 2440 ASSERT(!isPseudoElement());
2436 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId); 2441 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId);
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
3596 return 0; 3601 return 0;
3597 } 3602 }
3598 3603
3599 Attribute* UniqueElementData::attributeItem(unsigned index) 3604 Attribute* UniqueElementData::attributeItem(unsigned index)
3600 { 3605 {
3601 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3606 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3602 return &m_attributeVector.at(index); 3607 return &m_attributeVector.at(index);
3603 } 3608 }
3604 3609
3605 } // namespace WebCore 3610 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698