| 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.
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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 void Element::classAttributeChanged(const AtomicString& newClassString) | 1095 void Element::classAttributeChanged(const AtomicString& newClassString) |
| 1096 { | 1096 { |
| 1097 StyleResolver* styleResolver = document().styleResolver(); | 1097 StyleResolver* styleResolver = document().styleResolver(); |
| 1098 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl
eChangeType() < SubtreeStyleChange; | 1098 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl
eChangeType() < SubtreeStyleChange; |
| 1099 bool shouldInvalidateStyle = false; | 1099 bool shouldInvalidateStyle = false; |
| 1100 | 1100 |
| 1101 if (classStringHasClassName(newClassString)) { | 1101 if (classStringHasClassName(newClassString)) { |
| 1102 const bool shouldFoldCase = document().inQuirksMode(); | 1102 const bool shouldFoldCase = document().inQuirksMode(); |
| 1103 const SpaceSplitString oldClasses = elementData()->classNames(); | 1103 const SpaceSplitString oldClasses = ensureUniqueElementData()->className
s(); |
| 1104 elementData()->setClass(newClassString, shouldFoldCase); | 1104 elementData()->setClass(newClassString, shouldFoldCase); |
| 1105 const SpaceSplitString& newClasses = elementData()->classNames(); | 1105 const SpaceSplitString& newClasses = elementData()->classNames(); |
| 1106 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForCla
ssChange(oldClasses, newClasses, styleResolver->ensureRuleFeatureSet()); | 1106 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForCla
ssChange(oldClasses, newClasses, styleResolver->ensureRuleFeatureSet()); |
| 1107 } else { | 1107 } else if (elementData()) { |
| 1108 const SpaceSplitString& oldClasses = elementData()->classNames(); | 1108 const SpaceSplitString& oldClasses = elementData()->classNames(); |
| 1109 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForCla
ssChange(oldClasses, styleResolver->ensureRuleFeatureSet()); | 1109 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForCla
ssChange(oldClasses, styleResolver->ensureRuleFeatureSet()); |
| 1110 elementData()->clearClass(); | 1110 elementData()->clearClass(); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 if (hasRareData()) | 1113 if (hasRareData()) |
| 1114 elementRareData()->clearClassListValueForQuirksMode(); | 1114 elementRareData()->clearClassListValueForQuirksMode(); |
| 1115 | 1115 |
| 1116 if (shouldInvalidateStyle) | 1116 if (shouldInvalidateStyle) |
| 1117 setNeedsStyleRecalc(); | 1117 setNeedsStyleRecalc(); |
| (...skipping 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3620 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3620 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
| 3621 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3621 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
| 3622 if (hasTagName(optionTag) || hasTagName(optgroupTag)) | 3622 if (hasTagName(optionTag) || hasTagName(optgroupTag)) |
| 3623 return false; | 3623 return false; |
| 3624 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3624 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
| 3625 return false; | 3625 return false; |
| 3626 return true; | 3626 return true; |
| 3627 } | 3627 } |
| 3628 | 3628 |
| 3629 } // namespace WebCore | 3629 } // namespace WebCore |
| OLD | NEW |