| 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 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. | 1229 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. |
| 1230 if (this == frame->selection().rootEditableElement()) | 1230 if (this == frame->selection().rootEditableElement()) |
| 1231 return; | 1231 return; |
| 1232 | 1232 |
| 1233 // FIXME: We should restore the previous selection if there is one. | 1233 // FIXME: We should restore the previous selection if there is one. |
| 1234 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), DOWNSTREAM); | 1234 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), DOWNSTREAM); |
| 1235 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() | 1235 // Passing DoNotSetFocus as this function is called after FocusControlle
r::setFocusedElement() |
| 1236 // and we don't want to change the focus to a new Element. | 1236 // and we don't want to change the focus to a new Element. |
| 1237 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); | 1237 frame->selection().setSelection(newSelection, FrameSelection::CloseTypi
ng | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus); |
| 1238 frame->selection().revealSelection(); | 1238 frame->selection().revealSelection(); |
| 1239 } else if (renderer() && !renderer()->isWidget()) | 1239 } else if (renderer()) |
| 1240 renderer()->scrollRectToVisible(boundingBox()); | 1240 renderer()->scrollRectToVisible(boundingBox()); |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 void Element::blur() | 1243 void Element::blur() |
| 1244 { | 1244 { |
| 1245 if (treeScope().adjustedFocusedElement() == this) { | 1245 if (treeScope().adjustedFocusedElement() == this) { |
| 1246 Document& doc = document(); | 1246 Document& doc = document(); |
| 1247 if (doc.page()) | 1247 if (doc.page()) |
| 1248 doc.page()->focusController().setFocusedElement(0, doc.frame()); | 1248 doc.page()->focusController().setFocusedElement(0, doc.frame()); |
| 1249 else | 1249 else |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 return false; | 1802 return false; |
| 1803 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. | 1803 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. |
| 1804 // See comments in RenderObject::setStyle(). | 1804 // See comments in RenderObject::setStyle(). |
| 1805 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? | 1805 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? |
| 1806 if (isHTMLCanvasElement(*this)) | 1806 if (isHTMLCanvasElement(*this)) |
| 1807 return false; | 1807 return false; |
| 1808 return true; | 1808 return true; |
| 1809 } | 1809 } |
| 1810 | 1810 |
| 1811 } // namespace blink | 1811 } // namespace blink |
| OLD | NEW |