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 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat
eWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); | 1019 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat
eWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); |
1020 } | 1020 } |
1021 | 1021 |
1022 void ContainerNode::setActive(bool down) | 1022 void ContainerNode::setActive(bool down) |
1023 { | 1023 { |
1024 if (down == active()) | 1024 if (down == active()) |
1025 return; | 1025 return; |
1026 | 1026 |
1027 Node::setActive(down); | 1027 Node::setActive(down); |
1028 | 1028 |
1029 // FIXME: Why does this not need to handle the display: none transition like
:hover does? | 1029 if (!layoutObject()) { |
1030 if (layoutObject()) { | |
1031 if (computedStyle()->affectedByActive()) { | |
1032 StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoI
dFirstLetter) ? SubtreeStyleChange : LocalStyleChange; | |
1033 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createW
ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active)); | |
1034 } | |
1035 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActi
ve()) | 1030 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActi
ve()) |
1036 toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive); | 1031 toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive); |
| 1032 else |
| 1033 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::c
reateWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active)
); |
| 1034 return; |
| 1035 } |
1037 | 1036 |
1038 LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControl
State); | 1037 if (computedStyle()->affectedByActive()) { |
| 1038 StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoIdFir
stLetter) ? SubtreeStyleChange : LocalStyleChange; |
| 1039 setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithE
xtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active)); |
1039 } | 1040 } |
| 1041 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive()
) |
| 1042 toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive); |
| 1043 |
| 1044 LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControlStat
e); |
1040 } | 1045 } |
1041 | 1046 |
1042 void ContainerNode::setHovered(bool over) | 1047 void ContainerNode::setHovered(bool over) |
1043 { | 1048 { |
1044 if (over == hovered()) | 1049 if (over == hovered()) |
1045 return; | 1050 return; |
1046 | 1051 |
1047 Node::setHovered(over); | 1052 Node::setHovered(over); |
1048 | 1053 |
1049 // If :hover sets display: none we lose our hover but still need to recalc o
ur style. | 1054 // If :hover sets display: none we lose our hover but still need to recalc o
ur style. |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 return true; | 1390 return true; |
1386 | 1391 |
1387 if (node->isElementNode() && toElement(node)->shadow()) | 1392 if (node->isElementNode() && toElement(node)->shadow()) |
1388 return true; | 1393 return true; |
1389 | 1394 |
1390 return false; | 1395 return false; |
1391 } | 1396 } |
1392 #endif | 1397 #endif |
1393 | 1398 |
1394 } // namespace blink | 1399 } // namespace blink |
OLD | NEW |