| 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. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
| 8 * All rights reserved. | 8 * All rights reserved. |
| 9 * (C) 2007 Eric Seidel (eric@webkit.org) | 9 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 10 * | 10 * |
| (...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2866 | 2866 |
| 2867 String Element::innerHTML() const { | 2867 String Element::innerHTML() const { |
| 2868 return createMarkup(this, ChildrenOnly); | 2868 return createMarkup(this, ChildrenOnly); |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 String Element::outerHTML() const { | 2871 String Element::outerHTML() const { |
| 2872 return createMarkup(this); | 2872 return createMarkup(this); |
| 2873 } | 2873 } |
| 2874 | 2874 |
| 2875 void Element::setInnerHTML(const String& html, ExceptionState& exceptionState) { | 2875 void Element::setInnerHTML(const String& html, ExceptionState& exceptionState) { |
| 2876 InspectorInstrumentation::breakIfNeeded(&document(), "Element.setInnerHTML"); | 2876 probe::breakIfNeeded(&document(), "Element.setInnerHTML"); |
| 2877 if (DocumentFragment* fragment = createFragmentForInnerOuterHTML( | 2877 if (DocumentFragment* fragment = createFragmentForInnerOuterHTML( |
| 2878 html, this, AllowScriptingContent, "innerHTML", exceptionState)) { | 2878 html, this, AllowScriptingContent, "innerHTML", exceptionState)) { |
| 2879 ContainerNode* container = this; | 2879 ContainerNode* container = this; |
| 2880 if (isHTMLTemplateElement(*this)) | 2880 if (isHTMLTemplateElement(*this)) |
| 2881 container = toHTMLTemplateElement(this)->content(); | 2881 container = toHTMLTemplateElement(this)->content(); |
| 2882 replaceChildrenWithFragment(container, fragment, exceptionState); | 2882 replaceChildrenWithFragment(container, fragment, exceptionState); |
| 2883 } | 2883 } |
| 2884 } | 2884 } |
| 2885 | 2885 |
| 2886 void Element::setOuterHTML(const String& html, ExceptionState& exceptionState) { | 2886 void Element::setOuterHTML(const String& html, ExceptionState& exceptionState) { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3353 document().styleEngine().ensureResolver().createPseudoElementIfNeeded( | 3353 document().styleEngine().ensureResolver().createPseudoElementIfNeeded( |
| 3354 *this, pseudoId); | 3354 *this, pseudoId); |
| 3355 if (!element) | 3355 if (!element) |
| 3356 return; | 3356 return; |
| 3357 | 3357 |
| 3358 if (pseudoId == PseudoIdBackdrop) | 3358 if (pseudoId == PseudoIdBackdrop) |
| 3359 document().addToTopLayer(element, this); | 3359 document().addToTopLayer(element, this); |
| 3360 element->insertedInto(this); | 3360 element->insertedInto(this); |
| 3361 element->attachLayoutTree(); | 3361 element->attachLayoutTree(); |
| 3362 | 3362 |
| 3363 InspectorInstrumentation::pseudoElementCreated(element); | 3363 probe::pseudoElementCreated(element); |
| 3364 | 3364 |
| 3365 ensureElementRareData().setPseudoElement(pseudoId, element); | 3365 ensureElementRareData().setPseudoElement(pseudoId, element); |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 PseudoElement* Element::pseudoElement(PseudoId pseudoId) const { | 3368 PseudoElement* Element::pseudoElement(PseudoId pseudoId) const { |
| 3369 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : nullptr; | 3369 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : nullptr; |
| 3370 } | 3370 } |
| 3371 | 3371 |
| 3372 LayoutObject* Element::pseudoElementLayoutObject(PseudoId pseudoId) const { | 3372 LayoutObject* Element::pseudoElementLayoutObject(PseudoId pseudoId) const { |
| 3373 if (PseudoElement* element = pseudoElement(pseudoId)) | 3373 if (PseudoElement* element = pseudoElement(pseudoId)) |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3628 newValue); | 3628 newValue); |
| 3629 } | 3629 } |
| 3630 } | 3630 } |
| 3631 | 3631 |
| 3632 if (MutationObserverInterestGroup* recipients = | 3632 if (MutationObserverInterestGroup* recipients = |
| 3633 MutationObserverInterestGroup::createForAttributesMutation(*this, | 3633 MutationObserverInterestGroup::createForAttributesMutation(*this, |
| 3634 name)) | 3634 name)) |
| 3635 recipients->enqueueMutationRecord( | 3635 recipients->enqueueMutationRecord( |
| 3636 MutationRecord::createAttributes(this, name, oldValue)); | 3636 MutationRecord::createAttributes(this, name, oldValue)); |
| 3637 | 3637 |
| 3638 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); | 3638 probe::willModifyDOMAttr(this, oldValue, newValue); |
| 3639 } | 3639 } |
| 3640 | 3640 |
| 3641 DISABLE_CFI_PERF | 3641 DISABLE_CFI_PERF |
| 3642 void Element::didAddAttribute(const QualifiedName& name, | 3642 void Element::didAddAttribute(const QualifiedName& name, |
| 3643 const AtomicString& value) { | 3643 const AtomicString& value) { |
| 3644 if (name == HTMLNames::idAttr) | 3644 if (name == HTMLNames::idAttr) |
| 3645 updateId(nullAtom, value); | 3645 updateId(nullAtom, value); |
| 3646 attributeChanged(AttributeModificationParams( | 3646 attributeChanged(AttributeModificationParams( |
| 3647 name, nullAtom, value, AttributeModificationReason::kDirectly)); | 3647 name, nullAtom, value, AttributeModificationReason::kDirectly)); |
| 3648 InspectorInstrumentation::didModifyDOMAttr(this, name, value); | 3648 probe::didModifyDOMAttr(this, name, value); |
| 3649 dispatchSubtreeModifiedEvent(); | 3649 dispatchSubtreeModifiedEvent(); |
| 3650 } | 3650 } |
| 3651 | 3651 |
| 3652 void Element::didModifyAttribute(const QualifiedName& name, | 3652 void Element::didModifyAttribute(const QualifiedName& name, |
| 3653 const AtomicString& oldValue, | 3653 const AtomicString& oldValue, |
| 3654 const AtomicString& newValue) { | 3654 const AtomicString& newValue) { |
| 3655 if (name == HTMLNames::idAttr) | 3655 if (name == HTMLNames::idAttr) |
| 3656 updateId(oldValue, newValue); | 3656 updateId(oldValue, newValue); |
| 3657 attributeChanged(AttributeModificationParams( | 3657 attributeChanged(AttributeModificationParams( |
| 3658 name, oldValue, newValue, AttributeModificationReason::kDirectly)); | 3658 name, oldValue, newValue, AttributeModificationReason::kDirectly)); |
| 3659 InspectorInstrumentation::didModifyDOMAttr(this, name, newValue); | 3659 probe::didModifyDOMAttr(this, name, newValue); |
| 3660 // Do not dispatch a DOMSubtreeModified event here; see bug 81141. | 3660 // Do not dispatch a DOMSubtreeModified event here; see bug 81141. |
| 3661 } | 3661 } |
| 3662 | 3662 |
| 3663 void Element::didRemoveAttribute(const QualifiedName& name, | 3663 void Element::didRemoveAttribute(const QualifiedName& name, |
| 3664 const AtomicString& oldValue) { | 3664 const AtomicString& oldValue) { |
| 3665 if (name == HTMLNames::idAttr) | 3665 if (name == HTMLNames::idAttr) |
| 3666 updateId(oldValue, nullAtom); | 3666 updateId(oldValue, nullAtom); |
| 3667 attributeChanged(AttributeModificationParams( | 3667 attributeChanged(AttributeModificationParams( |
| 3668 name, oldValue, nullAtom, AttributeModificationReason::kDirectly)); | 3668 name, oldValue, nullAtom, AttributeModificationReason::kDirectly)); |
| 3669 InspectorInstrumentation::didRemoveDOMAttr(this, name); | 3669 probe::didRemoveDOMAttr(this, name); |
| 3670 dispatchSubtreeModifiedEvent(); | 3670 dispatchSubtreeModifiedEvent(); |
| 3671 } | 3671 } |
| 3672 | 3672 |
| 3673 static bool needsURLResolutionForInlineStyle(const Element& element, | 3673 static bool needsURLResolutionForInlineStyle(const Element& element, |
| 3674 const Document& oldDocument, | 3674 const Document& oldDocument, |
| 3675 const Document& newDocument) { | 3675 const Document& newDocument) { |
| 3676 if (oldDocument == newDocument) | 3676 if (oldDocument == newDocument) |
| 3677 return false; | 3677 return false; |
| 3678 if (oldDocument.baseURL() == newDocument.baseURL()) | 3678 if (oldDocument.baseURL() == newDocument.baseURL()) |
| 3679 return false; | 3679 return false; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3964 this, document().url(), String(), startLineNumber, | 3964 this, document().url(), String(), startLineNumber, |
| 3965 newStyleString)) { | 3965 newStyleString)) { |
| 3966 setInlineStyleFromString(newStyleString); | 3966 setInlineStyleFromString(newStyleString); |
| 3967 } | 3967 } |
| 3968 | 3968 |
| 3969 elementData()->m_styleAttributeIsDirty = false; | 3969 elementData()->m_styleAttributeIsDirty = false; |
| 3970 | 3970 |
| 3971 setNeedsStyleRecalc( | 3971 setNeedsStyleRecalc( |
| 3972 LocalStyleChange, | 3972 LocalStyleChange, |
| 3973 StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange)); | 3973 StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange)); |
| 3974 InspectorInstrumentation::didInvalidateStyleAttr(this); | 3974 probe::didInvalidateStyleAttr(this); |
| 3975 } | 3975 } |
| 3976 | 3976 |
| 3977 void Element::inlineStyleChanged() { | 3977 void Element::inlineStyleChanged() { |
| 3978 DCHECK(isStyledElement()); | 3978 DCHECK(isStyledElement()); |
| 3979 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create( | 3979 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create( |
| 3980 StyleChangeReason::Inline)); | 3980 StyleChangeReason::Inline)); |
| 3981 DCHECK(elementData()); | 3981 DCHECK(elementData()); |
| 3982 elementData()->m_styleAttributeIsDirty = true; | 3982 elementData()->m_styleAttributeIsDirty = true; |
| 3983 InspectorInstrumentation::didInvalidateStyleAttr(this); | 3983 probe::didInvalidateStyleAttr(this); |
| 3984 | 3984 |
| 3985 if (MutationObserverInterestGroup* recipients = | 3985 if (MutationObserverInterestGroup* recipients = |
| 3986 MutationObserverInterestGroup::createForAttributesMutation( | 3986 MutationObserverInterestGroup::createForAttributesMutation( |
| 3987 *this, styleAttr)) { | 3987 *this, styleAttr)) { |
| 3988 // We don't use getAttribute() here to get a style attribute value | 3988 // We don't use getAttribute() here to get a style attribute value |
| 3989 // before the change. | 3989 // before the change. |
| 3990 AtomicString oldValue; | 3990 AtomicString oldValue; |
| 3991 if (const Attribute* attribute = | 3991 if (const Attribute* attribute = |
| 3992 elementData()->attributes().find(styleAttr)) | 3992 elementData()->attributes().find(styleAttr)) |
| 3993 oldValue = attribute->value(); | 3993 oldValue = attribute->value(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4201 } | 4201 } |
| 4202 | 4202 |
| 4203 DEFINE_TRACE_WRAPPERS(Element) { | 4203 DEFINE_TRACE_WRAPPERS(Element) { |
| 4204 if (hasRareData()) { | 4204 if (hasRareData()) { |
| 4205 visitor->traceWrappers(elementRareData()); | 4205 visitor->traceWrappers(elementRareData()); |
| 4206 } | 4206 } |
| 4207 ContainerNode::traceWrappers(visitor); | 4207 ContainerNode::traceWrappers(visitor); |
| 4208 } | 4208 } |
| 4209 | 4209 |
| 4210 } // namespace blink | 4210 } // namespace blink |
| OLD | NEW |