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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 946083003: Rename Sky's custom2 to custom (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/core/dom/DocumentInit.cpp ('k') | sky/engine/core/dom/custom/custom_element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "sky/engine/core/dom/ElementRareData.h" 49 #include "sky/engine/core/dom/ElementRareData.h"
50 #include "sky/engine/core/dom/ElementTraversal.h" 50 #include "sky/engine/core/dom/ElementTraversal.h"
51 #include "sky/engine/core/dom/ExceptionCode.h" 51 #include "sky/engine/core/dom/ExceptionCode.h"
52 #include "sky/engine/core/dom/MutationObserverInterestGroup.h" 52 #include "sky/engine/core/dom/MutationObserverInterestGroup.h"
53 #include "sky/engine/core/dom/MutationRecord.h" 53 #include "sky/engine/core/dom/MutationRecord.h"
54 #include "sky/engine/core/dom/NodeRenderStyle.h" 54 #include "sky/engine/core/dom/NodeRenderStyle.h"
55 #include "sky/engine/core/dom/RenderTreeBuilder.h" 55 #include "sky/engine/core/dom/RenderTreeBuilder.h"
56 #include "sky/engine/core/dom/SelectorQuery.h" 56 #include "sky/engine/core/dom/SelectorQuery.h"
57 #include "sky/engine/core/dom/StyleEngine.h" 57 #include "sky/engine/core/dom/StyleEngine.h"
58 #include "sky/engine/core/dom/Text.h" 58 #include "sky/engine/core/dom/Text.h"
59 #include "sky/engine/core/dom/custom2/new_custom_element.h" 59 #include "sky/engine/core/dom/custom/custom_element.h"
60 #include "sky/engine/core/dom/shadow/InsertionPoint.h" 60 #include "sky/engine/core/dom/shadow/InsertionPoint.h"
61 #include "sky/engine/core/dom/shadow/ShadowRoot.h" 61 #include "sky/engine/core/dom/shadow/ShadowRoot.h"
62 #include "sky/engine/core/editing/FrameSelection.h" 62 #include "sky/engine/core/editing/FrameSelection.h"
63 #include "sky/engine/core/editing/TextIterator.h" 63 #include "sky/engine/core/editing/TextIterator.h"
64 #include "sky/engine/core/editing/htmlediting.h" 64 #include "sky/engine/core/editing/htmlediting.h"
65 #include "sky/engine/core/events/EventDispatcher.h" 65 #include "sky/engine/core/events/EventDispatcher.h"
66 #include "sky/engine/core/events/FocusEvent.h" 66 #include "sky/engine/core/events/FocusEvent.h"
67 #include "sky/engine/core/frame/FrameView.h" 67 #include "sky/engine/core/frame/FrameView.h"
68 #include "sky/engine/core/frame/LocalFrame.h" 68 #include "sky/engine/core/frame/LocalFrame.h"
69 #include "sky/engine/core/frame/Settings.h" 69 #include "sky/engine/core/frame/Settings.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 void Element::insertedInto(ContainerNode* insertionPoint) 640 void Element::insertedInto(ContainerNode* insertionPoint)
641 { 641 {
642 // need to do superclass processing first so inDocument() is true 642 // need to do superclass processing first so inDocument() is true
643 // by the time we reach updateId 643 // by the time we reach updateId
644 ContainerNode::insertedInto(insertionPoint); 644 ContainerNode::insertedInto(insertionPoint);
645 645
646 if (!insertionPoint->isInTreeScope()) 646 if (!insertionPoint->isInTreeScope())
647 return; 647 return;
648 648
649 if (isUpgradedCustomElement() && inDocument()) 649 if (isUpgradedCustomElement() && inDocument())
650 NewCustomElement::DidAttach(this, document()); 650 CustomElement::DidAttach(this, document());
651 651
652 TreeScope& scope = insertionPoint->treeScope(); 652 TreeScope& scope = insertionPoint->treeScope();
653 if (scope != treeScope()) 653 if (scope != treeScope())
654 return; 654 return;
655 655
656 const AtomicString& idValue = getIdAttribute(); 656 const AtomicString& idValue = getIdAttribute();
657 if (!idValue.isNull()) 657 if (!idValue.isNull())
658 updateId(scope, nullAtom, idValue); 658 updateId(scope, nullAtom, idValue);
659 } 659 }
660 660
661 void Element::removedFrom(ContainerNode* insertionPoint) 661 void Element::removedFrom(ContainerNode* insertionPoint)
662 { 662 {
663 bool wasInDocument = insertionPoint->inDocument(); 663 bool wasInDocument = insertionPoint->inDocument();
664 664
665 if (insertionPoint->isInTreeScope() && treeScope() == document()) { 665 if (insertionPoint->isInTreeScope() && treeScope() == document()) {
666 const AtomicString& idValue = getIdAttribute(); 666 const AtomicString& idValue = getIdAttribute();
667 if (!idValue.isNull()) 667 if (!idValue.isNull())
668 updateId(insertionPoint->treeScope(), idValue, nullAtom); 668 updateId(insertionPoint->treeScope(), idValue, nullAtom);
669 } 669 }
670 670
671 ContainerNode::removedFrom(insertionPoint); 671 ContainerNode::removedFrom(insertionPoint);
672 if (wasInDocument) { 672 if (wasInDocument) {
673 if (isUpgradedCustomElement()) 673 if (isUpgradedCustomElement())
674 NewCustomElement::DidDetach(this, insertionPoint->document()); 674 CustomElement::DidDetach(this, insertionPoint->document());
675 } 675 }
676 } 676 }
677 677
678 void Element::attach(const AttachContext& context) 678 void Element::attach(const AttachContext& context)
679 { 679 {
680 ASSERT(document().inStyleRecalc()); 680 ASSERT(document().inStyleRecalc());
681 681
682 if (isInsertionPoint()) 682 if (isInsertionPoint())
683 toInsertionPoint(this)->attachDistribution(context); 683 toInsertionPoint(this)->attachDistribution(context);
684 684
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 1291
1292 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue) 1292 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
1293 { 1293 {
1294 if (name == HTMLNames::idAttr) 1294 if (name == HTMLNames::idAttr)
1295 updateId(oldValue, newValue); 1295 updateId(oldValue, newValue);
1296 1296
1297 if (inActiveDocument() && styleChangeType() < SubtreeStyleChange && affected ByAttributeSelector(name.localName())) 1297 if (inActiveDocument() && styleChangeType() < SubtreeStyleChange && affected ByAttributeSelector(name.localName()))
1298 setNeedsStyleRecalc(LocalStyleChange); 1298 setNeedsStyleRecalc(LocalStyleChange);
1299 1299
1300 if (isUpgradedCustomElement()) 1300 if (isUpgradedCustomElement())
1301 NewCustomElement::AttributeDidChange(this, name.localName(), oldValue, n ewValue); 1301 CustomElement::AttributeDidChange(this, name.localName(), oldValue, newV alue);
1302 1302
1303 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter estGroup::createForAttributesMutation(*this, name)) 1303 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter estGroup::createForAttributesMutation(*this, name))
1304 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue)); 1304 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue));
1305 } 1305 }
1306 1306
1307 static bool needsURLResolutionForInlineStyle(const Element& element, const Docum ent& oldDocument, const Document& newDocument) 1307 static bool needsURLResolutionForInlineStyle(const Element& element, const Docum ent& oldDocument, const Document& newDocument)
1308 { 1308 {
1309 if (oldDocument == newDocument) 1309 if (oldDocument == newDocument)
1310 return false; 1310 return false;
1311 if (oldDocument.baseURL() == newDocument.baseURL()) 1311 if (oldDocument.baseURL() == newDocument.baseURL())
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 return false; 1567 return false;
1568 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1568 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1569 return true; 1569 return true;
1570 // Host rules could also have effects. 1570 // Host rules could also have effects.
1571 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1571 if (ShadowRoot* shadowRoot = this->shadowRoot())
1572 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1572 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1573 return false; 1573 return false;
1574 } 1574 }
1575 1575
1576 } // namespace blink 1576 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/DocumentInit.cpp ('k') | sky/engine/core/dom/custom/custom_element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698