<rdar://problem/
18490587>
This change broke selection when editing Confluence wiki pages.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::nodeOrItsAncestorNeedsStyleRecalc):
(WebCore::ComputedStyleExtractor::propertyValue):
* dom/Document.cpp:
(WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::Document::updateStyleIfNeededForNode): Deleted.
* dom/Document.h:
* editing/htmlediting.cpp:
(WebCore::isEditablePosition):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177048
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-12-09 Andreas Kling <akling@apple.com>
+
+ Roll out r165076.
+ <rdar://problem/18490587>
+
+ This change broke selection when editing Confluence wiki pages.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::nodeOrItsAncestorNeedsStyleRecalc):
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ * dom/Document.cpp:
+ (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
+ (WebCore::Document::updateStyleIfNeededForNode): Deleted.
+ * dom/Document.h:
+ * editing/htmlediting.cpp:
+ (WebCore::isEditablePosition):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::forwardEvent):
+
2014-12-09 Myles C. Maxfield <mmaxfield@apple.com>
Fix iOS build after r177035.
return ComputedStyleExtractor(m_node, m_allowVisitedStyle, m_pseudoElementSpecifier).copyProperties();
}
+static inline bool nodeOrItsAncestorNeedsStyleRecalc(Node* styledNode)
+{
+ if (styledNode->document().hasPendingForcedStyleRecalc())
+ return true;
+ for (Node* n = styledNode; n; n = n->parentNode()) {// FIXME: parentOrShadowHostNode() instead
+ if (n->needsStyleRecalc())
+ return true;
+ }
+ return false;
+}
+
static inline PassRefPtr<RenderStyle> computeRenderStyleForProperty(Node* styledNode, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID)
{
RenderObject* renderer = styledNode->renderer();
if (updateLayout) {
Document& document = styledNode->document();
- if (document.updateStyleIfNeededForNode(*styledNode)) {
+ if (nodeOrItsAncestorNeedsStyleRecalc(styledNode)) {
+ document.updateStyleIfNeeded();
// The style recalc could have caused the styled node to be discarded or replaced
// if it was a PseudoElement so we need to update it.
styledNode = this->styledNode();
}
#endif // ENABLE(SUBTLE_CRYPTO)
-static inline bool nodeOrItsAncestorNeedsStyleRecalc(const Node& node)
-{
- if (node.needsStyleRecalc())
- return true;
-
- const Node* currentNode = &node;
- const Element* ancestor = currentNode->parentOrShadowHostElement();
- while (ancestor) {
- if (ancestor->needsStyleRecalc())
- return true;
-
- if (ancestor->directChildNeedsStyleRecalc() && currentNode->styleIsAffectedByPreviousSibling())
- return true;
-
- currentNode = ancestor;
- ancestor = currentNode->parentOrShadowHostElement();
- }
- return false;
-}
-
-bool Document::updateStyleIfNeededForNode(const Node& node)
-{
- if (!hasPendingForcedStyleRecalc() && !(childNeedsStyleRecalc() && nodeOrItsAncestorNeedsStyleRecalc(node)))
- return false;
- updateStyleIfNeeded();
- return true;
-}
-
Element* Document::activeElement()
{
if (Element* element = treeScope().focusedElement())
void recalcStyle(Style::Change = Style::NoChange);
WEBCORE_EXPORT void updateStyleIfNeeded();
- bool updateStyleIfNeededForNode(const Node&);
WEBCORE_EXPORT void updateLayout();
if (!node)
return false;
if (updateStyle == UpdateStyle)
- node->document().updateStyleIfNeededForNode(*node);
+ node->document().updateStyleIfNeeded();
else
ASSERT(updateStyle == DoNotUpdateStyle);
|| event->type() == eventNames().blurEvent
|| event->type() == eventNames().focusEvent)
{
- element().document().updateStyleIfNeededForNode(element());
+ element().document().updateStyleIfNeeded();
if (element().renderer()) {
RenderTextControlSingleLine& renderTextControl = downcast<RenderTextControlSingleLine>(*element().renderer());