OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2039 int rightAligned = 0; | 2039 int rightAligned = 0; |
2040 #endif | 2040 #endif |
2041 IntPoint locationInRootFrame; | 2041 IntPoint locationInRootFrame; |
2042 | 2042 |
2043 Element* focusedElement = overrideTargetElement ? overrideTargetElement : do
c->focusedElement(); | 2043 Element* focusedElement = overrideTargetElement ? overrideTargetElement : do
c->focusedElement(); |
2044 FrameSelection& selection = m_frame->selection(); | 2044 FrameSelection& selection = m_frame->selection(); |
2045 Position start = selection.selection().start(); | 2045 Position start = selection.selection().start(); |
2046 VisualViewport& visualViewport = frameHost()->visualViewport(); | 2046 VisualViewport& visualViewport = frameHost()->visualViewport(); |
2047 | 2047 |
2048 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE
lement() || selection.isRange())) { | 2048 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE
lement() || selection.isRange())) { |
| 2049 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh
eets |
| 2050 // needs to be audited. See http://crbug.com/590369 for more details. |
| 2051 doc->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2052 |
2049 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select
ion().toNormalizedEphemeralRange()); | 2053 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select
ion().toNormalizedEphemeralRange()); |
2050 | 2054 |
2051 int x = rightAligned ? firstRect.maxX() : firstRect.x(); | 2055 int x = rightAligned ? firstRect.maxX() : firstRect.x(); |
2052 // In a multiline edit, firstRect.maxY() would endup on the next line, s
o -1. | 2056 // In a multiline edit, firstRect.maxY() would endup on the next line, s
o -1. |
2053 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; | 2057 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; |
2054 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); | 2058 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); |
2055 } else if (focusedElement) { | 2059 } else if (focusedElement) { |
2056 IntRect clippedRect = focusedElement->boundsInViewport(); | 2060 IntRect clippedRect = focusedElement->boundsInViewport(); |
2057 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen
ter()); | 2061 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen
ter()); |
2058 } else { | 2062 } else { |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 | 2564 |
2561 FrameHost* EventHandler::frameHost() const | 2565 FrameHost* EventHandler::frameHost() const |
2562 { | 2566 { |
2563 if (!m_frame->page()) | 2567 if (!m_frame->page()) |
2564 return nullptr; | 2568 return nullptr; |
2565 | 2569 |
2566 return &m_frame->page()->frameHost(); | 2570 return &m_frame->page()->frameHost(); |
2567 } | 2571 } |
2568 | 2572 |
2569 } // namespace blink | 2573 } // namespace blink |
OLD | NEW |