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

Side by Side Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 1765933003: style: Rename the PseudoId enum values to CamelCase and prefix them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum-clash-PseudoId: none Created 4 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
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 // This is used by FrameSelection to denote when the active-state of the page ha s changed 1092 // This is used by FrameSelection to denote when the active-state of the page ha s changed
1093 // independent of the focused element changing. 1093 // independent of the focused element changing.
1094 void ContainerNode::focusStateChanged() 1094 void ContainerNode::focusStateChanged()
1095 { 1095 {
1096 // If we're just changing the window's active state and the focused node has no 1096 // If we're just changing the window's active state and the focused node has no
1097 // layoutObject we can just ignore the state change. 1097 // layoutObject we can just ignore the state change.
1098 if (!layoutObject()) 1098 if (!layoutObject())
1099 return; 1099 return;
1100 1100
1101 if (computedStyle()->affectedByFocus()) { 1101 if (computedStyle()->affectedByFocus()) {
1102 StyleChangeType changeType = computedStyle()->hasPseudoStyle(FIRST_LETTE R) ? SubtreeStyleChange : LocalStyleChange; 1102 StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoIdFir stLetter) ? SubtreeStyleChange : LocalStyleChange;
1103 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithE xtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); 1103 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithE xtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
1104 } 1104 }
1105 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus()) 1105 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus())
1106 toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus); 1106 toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus);
1107 1107
1108 LayoutTheme::theme().controlStateChanged(*layoutObject(), FocusControlState) ; 1108 LayoutTheme::theme().controlStateChanged(*layoutObject(), FocusControlState) ;
1109 } 1109 }
1110 1110
1111 void ContainerNode::setFocus(bool received) 1111 void ContainerNode::setFocus(bool received)
1112 { 1112 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 void ContainerNode::setActive(bool down) 1145 void ContainerNode::setActive(bool down)
1146 { 1146 {
1147 if (down == active()) 1147 if (down == active())
1148 return; 1148 return;
1149 1149
1150 Node::setActive(down); 1150 Node::setActive(down);
1151 1151
1152 // FIXME: Why does this not need to handle the display: none transition like :hover does? 1152 // FIXME: Why does this not need to handle the display: none transition like :hover does?
1153 if (layoutObject()) { 1153 if (layoutObject()) {
1154 if (computedStyle()->affectedByActive()) { 1154 if (computedStyle()->affectedByActive()) {
1155 StyleChangeType changeType = computedStyle()->hasPseudoStyle(FIRST_L ETTER) ? SubtreeStyleChange : LocalStyleChange; 1155 StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoI dFirstLetter) ? SubtreeStyleChange : LocalStyleChange;
1156 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createW ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active)); 1156 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createW ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
1157 } 1157 }
1158 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActi ve()) 1158 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActi ve())
1159 toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive); 1159 toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
1160 1160
1161 LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControl State); 1161 LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControl State);
1162 } 1162 }
1163 } 1163 }
1164 1164
1165 void ContainerNode::setHovered(bool over) 1165 void ContainerNode::setHovered(bool over)
1166 { 1166 {
1167 if (over == hovered()) 1167 if (over == hovered())
1168 return; 1168 return;
1169 1169
1170 Node::setHovered(over); 1170 Node::setHovered(over);
1171 1171
1172 // If :hover sets display: none we lose our hover but still need to recalc o ur style. 1172 // If :hover sets display: none we lose our hover but still need to recalc o ur style.
1173 if (!layoutObject()) { 1173 if (!layoutObject()) {
1174 if (over) 1174 if (over)
1175 return; 1175 return;
1176 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHove r()) 1176 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHove r())
1177 toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover); 1177 toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
1178 else 1178 else
1179 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::c reateWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover)) ; 1179 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::c reateWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover)) ;
1180 return; 1180 return;
1181 } 1181 }
1182 1182
1183 if (computedStyle()->affectedByHover()) { 1183 if (computedStyle()->affectedByHover()) {
1184 StyleChangeType changeType = computedStyle()->hasPseudoStyle(FIRST_LETTE R) ? SubtreeStyleChange : LocalStyleChange; 1184 StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoIdFir stLetter) ? SubtreeStyleChange : LocalStyleChange;
1185 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithE xtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover)); 1185 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithE xtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
1186 } 1186 }
1187 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover()) 1187 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover())
1188 toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover); 1188 toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
1189 1189
1190 LayoutTheme::theme().controlStateChanged(*layoutObject(), HoverControlState) ; 1190 LayoutTheme::theme().controlStateChanged(*layoutObject(), HoverControlState) ;
1191 } 1191 }
1192 1192
1193 PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::children() 1193 PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::children()
1194 { 1194 {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 return true; 1509 return true;
1510 1510
1511 if (node->isElementNode() && toElement(node)->shadow()) 1511 if (node->isElementNode() && toElement(node)->shadow())
1512 return true; 1512 return true;
1513 1513
1514 return false; 1514 return false;
1515 } 1515 }
1516 #endif 1516 #endif
1517 1517
1518 } // namespace blink 1518 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698