summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/Element.cpp')
-rw-r--r--WebCore/dom/Element.cpp10
1 files changed, 7 insertions, 3 deletions
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);