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

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

Issue 182903004: Merge 167817 "Fix crash in which elementData() might be null." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1847/
Patch Set: Created 6 years, 9 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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 if (newClassString.is8Bit()) 1078 if (newClassString.is8Bit())
1079 return classStringHasClassName(newClassString.characters8(), length); 1079 return classStringHasClassName(newClassString.characters8(), length);
1080 return classStringHasClassName(newClassString.characters16(), length); 1080 return classStringHasClassName(newClassString.characters16(), length);
1081 } 1081 }
1082 1082
1083 void Element::classAttributeChanged(const AtomicString& newClassString) 1083 void Element::classAttributeChanged(const AtomicString& newClassString)
1084 { 1084 {
1085 StyleResolver* styleResolver = document().styleResolver(); 1085 StyleResolver* styleResolver = document().styleResolver();
1086 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl eChangeType() < SubtreeStyleChange; 1086 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl eChangeType() < SubtreeStyleChange;
1087 1087
1088 ASSERT(elementData());
1088 if (classStringHasClassName(newClassString)) { 1089 if (classStringHasClassName(newClassString)) {
1089 const bool shouldFoldCase = document().inQuirksMode(); 1090 const bool shouldFoldCase = document().inQuirksMode();
1090 const SpaceSplitString oldClasses = elementData()->classNames(); 1091 const SpaceSplitString oldClasses = elementData()->classNames();
1091 elementData()->setClass(newClassString, shouldFoldCase); 1092 elementData()->setClass(newClassString, shouldFoldCase);
1092 const SpaceSplitString& newClasses = elementData()->classNames(); 1093 const SpaceSplitString& newClasses = elementData()->classNames();
1093 if (testShouldInvalidateStyle) 1094 if (testShouldInvalidateStyle)
1094 styleResolver->ensureRuleFeatureSet().scheduleStyleInvalidationForCl assChange(oldClasses, newClasses, this); 1095 styleResolver->ensureRuleFeatureSet().scheduleStyleInvalidationForCl assChange(oldClasses, newClasses, this);
1095 } else { 1096 } else {
1096 const SpaceSplitString& oldClasses = elementData()->classNames(); 1097 const SpaceSplitString& oldClasses = elementData()->classNames();
1097 if (testShouldInvalidateStyle) 1098 if (testShouldInvalidateStyle)
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3532 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems 3533 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems
3533 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405 3534 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405
3534 if (hasTagName(optionTag) || hasTagName(optgroupTag)) 3535 if (hasTagName(optionTag) || hasTagName(optgroupTag))
3535 return false; 3536 return false;
3536 if (FullscreenElementStack::isActiveFullScreenElement(this)) 3537 if (FullscreenElementStack::isActiveFullScreenElement(this))
3537 return false; 3538 return false;
3538 return true; 3539 return true;
3539 } 3540 }
3540 3541
3541 } // namespace WebCore 3542 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/svg/filters/feColorMatrix-invalid-animation-expected.txt ('k') | Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698