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

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: fix failing tests Created 7 years, 6 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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 // When a shadow root exists, it does the work of attaching the children. 1337 // When a shadow root exists, it does the work of attaching the children.
1337 if (ElementShadow* shadow = this->shadow()) { 1338 if (ElementShadow* shadow = this->shadow()) {
1338 parentPusher.push(); 1339 parentPusher.push();
1339 shadow->attach(context); 1340 shadow->attach(context);
1340 } else if (firstChild()) 1341 } else if (firstChild())
1341 parentPusher.push(); 1342 parentPusher.push();
1342 1343
1343 ContainerNode::attach(context); 1344 ContainerNode::attach(context);
1344 1345
1345 createPseudoElementIfNeeded(AFTER); 1346 createPseudoElementIfNeeded(AFTER);
1347 createPseudoElementIfNeeded(BACKDROP);
1346 1348
1347 if (hasRareData()) { 1349 if (hasRareData()) {
1348 ElementRareData* data = elementRareData(); 1350 ElementRareData* data = elementRareData();
1349 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) { 1351 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) {
1350 if (isFocusable() && document()->focusedNode() == this) 1352 if (isFocusable() && document()->focusedNode() == this)
1351 document()->updateFocusAppearanceSoon(false /* don't restore sel ection */); 1353 document()->updateFocusAppearanceSoon(false /* don't restore sel ection */);
1352 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false); 1354 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false);
1353 } 1355 }
1354 } 1356 }
1355 1357
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
2395 // when RenderObject::isChildAllowed on our parent returns false for the 2397 // when RenderObject::isChildAllowed on our parent returns false for the
2396 // PseudoElement's renderer for each style recalc. 2398 // PseudoElement's renderer for each style recalc.
2397 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP seudoStyle(pseudoId))) 2399 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP seudoStyle(pseudoId)))
2398 elementRareData()->setPseudoElement(pseudoId, 0); 2400 elementRareData()->setPseudoElement(pseudoId, 0);
2399 } else if (change >= Inherit || needsStyleRecalc()) 2401 } else if (change >= Inherit || needsStyleRecalc())
2400 createPseudoElementIfNeeded(pseudoId); 2402 createPseudoElementIfNeeded(pseudoId);
2401 } 2403 }
2402 2404
2403 void Element::createPseudoElementIfNeeded(PseudoId pseudoId) 2405 void Element::createPseudoElementIfNeeded(PseudoId pseudoId)
2404 { 2406 {
2405 if (!document()->styleSheetCollection()->usesBeforeAfterRules()) 2407 if ((pseudoId == BEFORE || pseudoId == AFTER) && !document()->styleSheetColl ection()->usesBeforeAfterRules())
2408 return;
2409
2410 if (pseudoId == BACKDROP && !isInTopLayer())
2406 return; 2411 return;
2407 2412
2408 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud oStyle(pseudoId))) 2413 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud oStyle(pseudoId)))
2409 return; 2414 return;
2410 2415
2411 if (!renderer()->canHaveGeneratedChildren()) 2416 if (!renderer()->canHaveGeneratedChildren())
2412 return; 2417 return;
2413 2418
2414 ASSERT(!isPseudoElement()); 2419 ASSERT(!isPseudoElement());
2415 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId); 2420 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId);
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
3559 return 0; 3564 return 0;
3560 } 3565 }
3561 3566
3562 Attribute* UniqueElementData::attributeItem(unsigned index) 3567 Attribute* UniqueElementData::attributeItem(unsigned index)
3563 { 3568 {
3564 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3569 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3565 return &m_attributeVector.at(index); 3570 return &m_attributeVector.at(index);
3566 } 3571 }
3567 3572
3568 } // namespace WebCore 3573 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698