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

Side by Side Diff: Source/WebCore/dom/Element.h

Issue 14297020: Merge 147281 "Cross-Origin copy&paste / drag&drop allowing XSS v..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1453/
Patch Set: Created 7 years, 8 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // For exposing to DOM only. 373 // For exposing to DOM only.
374 NamedNodeMap* attributes() const; 374 NamedNodeMap* attributes() const;
375 375
376 // This method is called whenever an attribute is added, changed or removed. 376 // This method is called whenever an attribute is added, changed or removed.
377 virtual void attributeChanged(const QualifiedName&, const AtomicString&); 377 virtual void attributeChanged(const QualifiedName&, const AtomicString&);
378 virtual void parseAttribute(const QualifiedName&, const AtomicString&) { } 378 virtual void parseAttribute(const QualifiedName&, const AtomicString&) { }
379 379
380 // Only called by the parser immediately after element construction. 380 // Only called by the parser immediately after element construction.
381 void parserSetAttributes(const Vector<Attribute>&); 381 void parserSetAttributes(const Vector<Attribute>&);
382 382
383 void stripJavaScriptAttributes(Vector<Attribute>&); 383 // Remove attributes that might introduce scripting from the vector leaving the element unchanged.
384 void stripScriptingAttributes(Vector<Attribute>&) const;
384 385
385 const ElementData* elementData() const { return m_elementData.get(); } 386 const ElementData* elementData() const { return m_elementData.get(); }
386 UniqueElementData* ensureUniqueElementData(); 387 UniqueElementData* ensureUniqueElementData();
387 388
388 void synchronizeAllAttributes() const; 389 void synchronizeAllAttributes() const;
389 390
390 // Clones attributes only. 391 // Clones attributes only.
391 void cloneAttributesFromElement(const Element&); 392 void cloneAttributesFromElement(const Element&);
392 393
393 // Clones all attribute-derived data, including subclass specifics (through copyNonAttributeProperties.) 394 // Clones all attribute-derived data, including subclass specifics (through copyNonAttributeProperties.)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 448
448 void setIsInCanvasSubtree(bool); 449 void setIsInCanvasSubtree(bool);
449 bool isInCanvasSubtree() const; 450 bool isInCanvasSubtree() const;
450 451
451 AtomicString computeInheritedLanguage() const; 452 AtomicString computeInheritedLanguage() const;
452 Locale& locale() const; 453 Locale& locale() const;
453 454
454 virtual void accessKeyAction(bool /*sendToAnyEvent*/) { } 455 virtual void accessKeyAction(bool /*sendToAnyEvent*/) { }
455 456
456 virtual bool isURLAttribute(const Attribute&) const { return false; } 457 virtual bool isURLAttribute(const Attribute&) const { return false; }
458 virtual bool isHTMLContentAttribute(const Attribute&) const { return false; }
457 459
458 KURL getURLAttribute(const QualifiedName&) const; 460 KURL getURLAttribute(const QualifiedName&) const;
459 KURL getNonEmptyURLAttribute(const QualifiedName&) const; 461 KURL getNonEmptyURLAttribute(const QualifiedName&) const;
460 462
461 virtual const AtomicString& imageSourceURL() const; 463 virtual const AtomicString& imageSourceURL() const;
462 virtual String target() const { return String(); } 464 virtual String target() const { return String(); }
463 465
464 virtual void focus(bool restorePreviousSelection = true, FocusDirection = Fo cusDirectionNone); 466 virtual void focus(bool restorePreviousSelection = true, FocusDirection = Fo cusDirectionNone);
465 virtual void updateFocusAppearance(bool restorePreviousSelection); 467 virtual void updateFocusAppearance(bool restorePreviousSelection);
466 virtual void blur(); 468 virtual void blur();
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&); 721 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&);
720 722
721 ElementRareData* elementRareData() const; 723 ElementRareData* elementRareData() const;
722 ElementRareData* ensureElementRareData(); 724 ElementRareData* ensureElementRareData();
723 725
724 void detachAllAttrNodesFromElement(); 726 void detachAllAttrNodesFromElement();
725 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); 727 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value);
726 728
727 void createRendererIfNeeded(); 729 void createRendererIfNeeded();
728 730
729 bool isJavaScriptAttribute(const Attribute&); 731 bool isJavaScriptURLAttribute(const Attribute&) const;
730 bool isJavaScriptURLAttribute(const Attribute&);
731 732
732 RefPtr<ElementData> m_elementData; 733 RefPtr<ElementData> m_elementData;
733 }; 734 };
734 735
735 inline Element* toElement(Node* node) 736 inline Element* toElement(Node* node)
736 { 737 {
737 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isElementNode()); 738 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isElementNode());
738 return static_cast<Element*>(node); 739 return static_cast<Element*>(node);
739 } 740 }
740 741
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 { 984 {
984 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 985 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
985 if (m_isUnique) 986 if (m_isUnique)
986 return &static_cast<const UniqueElementData*>(this)->m_attributeVector.a t(index); 987 return &static_cast<const UniqueElementData*>(this)->m_attributeVector.a t(index);
987 return &static_cast<const ShareableElementData*>(this)->m_attributeArray[ind ex]; 988 return &static_cast<const ShareableElementData*>(this)->m_attributeArray[ind ex];
988 } 989 }
989 990
990 } // namespace 991 } // namespace
991 992
992 #endif 993 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/pasteboard/paste-noscript-expected.txt ('k') | Source/WebCore/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698