| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2402 // when RenderObject::isChildAllowed on our parent returns false for the | 2404 // when RenderObject::isChildAllowed on our parent returns false for the |
| 2403 // PseudoElement's renderer for each style recalc. | 2405 // PseudoElement's renderer for each style recalc. |
| 2404 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP
seudoStyle(pseudoId))) | 2406 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP
seudoStyle(pseudoId))) |
| 2405 elementRareData()->setPseudoElement(pseudoId, 0); | 2407 elementRareData()->setPseudoElement(pseudoId, 0); |
| 2406 } else if (change >= Inherit || needsStyleRecalc()) | 2408 } else if (change >= Inherit || needsStyleRecalc()) |
| 2407 createPseudoElementIfNeeded(pseudoId); | 2409 createPseudoElementIfNeeded(pseudoId); |
| 2408 } | 2410 } |
| 2409 | 2411 |
| 2410 void Element::createPseudoElementIfNeeded(PseudoId pseudoId) | 2412 void Element::createPseudoElementIfNeeded(PseudoId pseudoId) |
| 2411 { | 2413 { |
| 2412 if (!document()->styleSheetCollection()->usesBeforeAfterRules()) | 2414 if ((pseudoId == BEFORE || pseudoId == AFTER) && !document()->styleSheetColl
ection()->usesBeforeAfterRules()) |
| 2415 return; |
| 2416 |
| 2417 if (pseudoId == BACKDROP && !isInTopLayer()) |
| 2413 return; | 2418 return; |
| 2414 | 2419 |
| 2415 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud
oStyle(pseudoId))) | 2420 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseud
oStyle(pseudoId))) |
| 2416 return; | 2421 return; |
| 2417 | 2422 |
| 2418 if (!renderer()->canHaveGeneratedChildren()) | 2423 if (!renderer()->canHaveGeneratedChildren()) |
| 2419 return; | 2424 return; |
| 2420 | 2425 |
| 2421 ASSERT(!isPseudoElement()); | 2426 ASSERT(!isPseudoElement()); |
| 2422 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId); | 2427 RefPtr<PseudoElement> element = PseudoElement::create(this, pseudoId); |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3566 return 0; | 3571 return 0; |
| 3567 } | 3572 } |
| 3568 | 3573 |
| 3569 Attribute* UniqueElementData::attributeItem(unsigned index) | 3574 Attribute* UniqueElementData::attributeItem(unsigned index) |
| 3570 { | 3575 { |
| 3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3576 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
| 3572 return &m_attributeVector.at(index); | 3577 return &m_attributeVector.at(index); |
| 3573 } | 3578 } |
| 3574 | 3579 |
| 3575 } // namespace WebCore | 3580 } // namespace WebCore |
| OLD | NEW |