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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 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 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 DOMStringMap& Element::dataset() 2622 DOMStringMap& Element::dataset()
2623 { 2623 {
2624 ElementRareData& rareData = ensureElementRareData(); 2624 ElementRareData& rareData = ensureElementRareData();
2625 if (!rareData.dataset()) 2625 if (!rareData.dataset())
2626 rareData.setDataset(DatasetDOMStringMap::create(this)); 2626 rareData.setDataset(DatasetDOMStringMap::create(this));
2627 return *rareData.dataset(); 2627 return *rareData.dataset();
2628 } 2628 }
2629 2629
2630 KURL Element::getURLAttribute(const QualifiedName& name) const 2630 KURL Element::getURLAttribute(const QualifiedName& name) const
2631 { 2631 {
2632 #if ASSERT_ENABLED 2632 #if ENABLE(ASSERT)
2633 if (elementData()) { 2633 if (elementData()) {
2634 if (const Attribute* attribute = attributes().find(name)) 2634 if (const Attribute* attribute = attributes().find(name))
2635 ASSERT(isURLAttribute(*attribute)); 2635 ASSERT(isURLAttribute(*attribute));
2636 } 2636 }
2637 #endif 2637 #endif
2638 return document().completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute (name))); 2638 return document().completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute (name)));
2639 } 2639 }
2640 2640
2641 KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const 2641 KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const
2642 { 2642 {
2643 #if ASSERT_ENABLED 2643 #if ENABLE(ASSERT)
2644 if (elementData()) { 2644 if (elementData()) {
2645 if (const Attribute* attribute = attributes().find(name)) 2645 if (const Attribute* attribute = attributes().find(name))
2646 ASSERT(isURLAttribute(*attribute)); 2646 ASSERT(isURLAttribute(*attribute));
2647 } 2647 }
2648 #endif 2648 #endif
2649 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name)); 2649 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));
2650 if (value.isEmpty()) 2650 if (value.isEmpty())
2651 return KURL(); 2651 return KURL();
2652 return document().completeURL(value); 2652 return document().completeURL(value);
2653 } 2653 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 case SpellcheckAttributeFalse: 2765 case SpellcheckAttributeFalse:
2766 return false; 2766 return false;
2767 case SpellcheckAttributeDefault: 2767 case SpellcheckAttributeDefault:
2768 break; 2768 break;
2769 } 2769 }
2770 } 2770 }
2771 2771
2772 return true; 2772 return true;
2773 } 2773 }
2774 2774
2775 #ifndef NDEBUG 2775 #if ENABLE(ASSERT)
2776 bool Element::fastAttributeLookupAllowed(const QualifiedName& name) const 2776 bool Element::fastAttributeLookupAllowed(const QualifiedName& name) const
2777 { 2777 {
2778 if (name == HTMLNames::styleAttr) 2778 if (name == HTMLNames::styleAttr)
2779 return false; 2779 return false;
2780 2780
2781 if (isSVGElement()) 2781 if (isSVGElement())
2782 return !toSVGElement(this)->isAnimatableAttribute(name); 2782 return !toSVGElement(this)->isAnimatableAttribute(name);
2783 2783
2784 return true; 2784 return true;
2785 } 2785 }
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
3353 3353
3354 void Element::trace(Visitor* visitor) 3354 void Element::trace(Visitor* visitor)
3355 { 3355 {
3356 if (hasRareData()) 3356 if (hasRareData())
3357 visitor->trace(elementRareData()); 3357 visitor->trace(elementRareData());
3358 visitor->trace(m_elementData); 3358 visitor->trace(m_elementData);
3359 ContainerNode::trace(visitor); 3359 ContainerNode::trace(visitor);
3360 } 3360 }
3361 3361
3362 } // namespace WebCore 3362 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698