Move childrenAffectedBy bits from RenderStyle to Element
authorallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 13:09:40 +0000 (13:09 +0000)
committerallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 13:09:40 +0000 (13:09 +0000)
commit5367c945d1e8f7816bea86eb17f3b784528f3382
treeb78f611dfa0b0f6e4ea9ecc2b1022e55841fcf44
parent81abcc3ca82cc00ce6ad426b63c051ef1be882f3
Move childrenAffectedBy bits from RenderStyle to Element
https://bugs.webkit.org/show_bug.cgi?id=101448
https://bugs.webkit.org/show_bug.cgi?id=98021

Source/WebCore:

Reviewed by Antti Koivisto.

Moves facts observed about restyling dependencies out of RenderStyle and
into RareData for Node and Element. This also enables further cleanup
in related code that tried to deal with problems caused with the placement
of the data.

Test: fast/css/nth-child-not-in-rightmost.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkSelector):
(WebCore::SelectorChecker::checkOneSelector):
* css/SiblingTraversalStrategies.h:
(WebCore::DOMSiblingTraversalStrategy::countElementsBefore):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::sortAndTransferMatchedRules):
(WebCore::StyleResolver::canShareStyleWithElement):
(WebCore::parentElementPreventsSharing):
(WebCore::StyleResolver::locateSharedStyle):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::setActive):
(WebCore::ContainerNode::setHovered):
* dom/Element.cpp:
(WebCore::Element::detach):
(WebCore::Element::recalcStyle):
(WebCore::checkForEmptyStyleChange):
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::setChildrenAffectedByHover):
(WebCore::Element::setChildrenAffectedByActive):
(WebCore::Element::setChildrenAffectedByDrag):
(WebCore::Element::setChildrenAffectedByFirstChildRules):
(WebCore::Element::setChildrenAffectedByLastChildRules):
(WebCore::Element::setChildrenAffectedByDirectAdjacentRules):
(WebCore::Element::setChildrenAffectedByForwardPositionalRules):
(WebCore::Element::setChildrenAffectedByBackwardPositionalRules):
(WebCore::Element::setChildIndex):
(WebCore::Element::rareDataStyleAffectedByEmpty):
(WebCore::Element::rareDataChildrenAffectedByHover):
(WebCore::Element::rareDataChildrenAffectedByActive):
(WebCore::Element::rareDataChildrenAffectedByDrag):
(WebCore::Element::rareDataChildrenAffectedByFirstChildRules):
(WebCore::Element::rareDataChildrenAffectedByLastChildRules):
(WebCore::Element::rareDataChildrenAffectedByDirectAdjacentRules):
(WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules):
(WebCore::Element::rareDataChildrenAffectedByBackwardPositionalRules):
(WebCore::Element::rareDataChildIndex):
* dom/Element.h:
(Element):
(WebCore::Element::styleAffectedByEmpty):
(WebCore::Element::childrenAffectedByHover):
(WebCore::Element::childrenAffectedByActive):
(WebCore::Element::childrenAffectedByDrag):
(WebCore::Element::childrenAffectedByPositionalRules):
(WebCore::Element::childrenAffectedByFirstChildRules):
(WebCore::Element::childrenAffectedByLastChildRules):
(WebCore::Element::childrenAffectedByDirectAdjacentRules):
(WebCore::Element::childrenAffectedByForwardPositionalRules):
(WebCore::Element::childrenAffectedByBackwardPositionalRules):
(WebCore::Element::childIndex):
* dom/ElementRareData.h:
(ElementRareData):
(WebCore::ElementRareData::resetComputedStyle):
(WebCore::ElementRareData::resetDynamicRestyleObservations):
* dom/Node.cpp:
(WebCore::Node::diff):
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData):
(WebCore::NodeRareData::childrenAffectedByHover):
(WebCore::NodeRareData::setChildrenAffectedByHover):
(WebCore::NodeRareData::childrenAffectedByActive):
(WebCore::NodeRareData::setChildrenAffectedByActive):
(WebCore::NodeRareData::childrenAffectedByDrag):
(WebCore::NodeRareData::setChildrenAffectedByDrag):
(NodeRareData):
(WebCore::NodeRareData::childrenAffectedByFirstChildRules):
(WebCore::NodeRareData::setChildrenAffectedByFirstChildRules):
(WebCore::NodeRareData::childrenAffectedByLastChildRules):
(WebCore::NodeRareData::setChildrenAffectedByLastChildRules):
(WebCore::NodeRareData::childrenAffectedByDirectAdjacentRules):
(WebCore::NodeRareData::setChildrenAffectedByDirectAdjacentRules):
(WebCore::NodeRareData::childrenAffectedByForwardPositionalRules):
(WebCore::NodeRareData::setChildrenAffectedByForwardPositionalRules):
(WebCore::NodeRareData::childrenAffectedByBackwardPositionalRules):
(WebCore::NodeRareData::setChildrenAffectedByBackwardPositionalRules):
(WebCore::NodeRareData::childIndex):
(WebCore::NodeRareData::setChildIndex):
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
* page/TouchAdjustment.cpp:
(WebCore::TouchAdjustment::nodeRespondsToTapGesture):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateDragState):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::copyNonInheritedFrom):
* rendering/style/RenderStyle.h:

LayoutTests:

Reviewed by Antti Koivisto.
New test-case by Takashi Sakamoto

* fast/css/nth-child-not-in-rightmost-expected.html: Added.
* fast/css/nth-child-not-in-rightmost.html: Added.
* touchadjustment/event-triggered-widgets.html: Fix bug exposed by patch.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/nth-child-not-in-rightmost-expected.html [new file with mode: 0644]
LayoutTests/fast/css/nth-child-not-in-rightmost.html [new file with mode: 0644]
LayoutTests/touchadjustment/event-triggered-widgets.html
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SiblingTraversalStrategies.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementRareData.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/NodeRareData.h
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/page/TouchAdjustment.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h