From db14019a23d96bc8a444b6576a5da8bd1cfbc8b0 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 4 Aug 2010 11:41:34 +0100 Subject: Merge WebKit at r64523 : Initial merge by git. Change-Id: Ibb796c6802e757b1d9b40f58205cfbe4da95fcd4 --- WebCore/dom/Element.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'WebCore/dom/Element.cpp') diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp index a1ff56d..2fa75ce 100644 --- a/WebCore/dom/Element.cpp +++ b/WebCore/dom/Element.cpp @@ -905,7 +905,7 @@ void Element::recalcStyle(StyleChange change) detach(); attach(); // FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along. // attach recalulates the style for all children. No need to do it twice. - setNeedsStyleRecalc(NoStyleChange); + clearNeedsStyleRecalc(); clearChildNeedsStyleRecalc(); return; } @@ -971,7 +971,7 @@ void Element::recalcStyle(StyleChange change) forceCheckOfNextElementSibling = childRulesChanged && hasDirectAdjacentRules; } - setNeedsStyleRecalc(NoStyleChange); + clearNeedsStyleRecalc(); clearChildNeedsStyleRecalc(); } @@ -1330,9 +1330,13 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/) Frame* frame = document()->frame(); if (!frame) return; + + // When focusing an editable element in an iframe, don't reset the selection if it already contains a selection. + if (this == frame->selection()->rootEditableElement()) + return; // FIXME: We should restore the previous selection if there is one. - VisibleSelection newSelection = hasTagName(htmlTag) || hasTagName(bodyTag) ? VisibleSelection(Position(this, 0), DOWNSTREAM) : VisibleSelection::selectionFromContentsOfNode(this); + VisibleSelection newSelection = VisibleSelection(Position(this, 0), DOWNSTREAM); if (frame->shouldChangeSelection(newSelection)) { frame->selection()->setSelection(newSelection); -- cgit v1.1