OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 // needs to be audited. See http://crbug.com/590369 for more details. | 597 // needs to be audited. See http://crbug.com/590369 for more details. |
598 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 598 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
599 | 599 |
600 FrameSelection& selection = frame->selection(); | 600 FrameSelection& selection = frame->selection(); |
601 if (selection.computeVisibleSelectionInDOMTree() | 601 if (selection.computeVisibleSelectionInDOMTree() |
602 .toNormalizedEphemeralRange() | 602 .toNormalizedEphemeralRange() |
603 .isNull()) | 603 .isNull()) |
604 return false; | 604 return false; |
605 start = | 605 start = |
606 toWebTextDirection(primaryDirectionOf(*selection.start().anchorNode())); | 606 toWebTextDirection(primaryDirectionOf(*selection.start().anchorNode())); |
607 end = toWebTextDirection(primaryDirectionOf(*selection.end().anchorNode())); | 607 end = toWebTextDirection( |
| 608 primaryDirectionOf(*selection.computeVisibleSelectionInDOMTreeDeprecated() |
| 609 .end() |
| 610 .anchorNode())); |
608 return true; | 611 return true; |
609 } | 612 } |
610 | 613 |
611 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This | 614 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This |
612 // code needs to be refactored (http://crbug.com/629721). | 615 // code needs to be refactored (http://crbug.com/629721). |
613 bool WebFrameWidgetImpl::isSelectionAnchorFirst() const { | 616 bool WebFrameWidgetImpl::isSelectionAnchorFirst() const { |
614 if (const LocalFrame* frame = focusedLocalFrameInWidget()) { | 617 if (const LocalFrame* frame = focusedLocalFrameInWidget()) { |
615 return frame->selection() | 618 return frame->selection() |
616 .computeVisibleSelectionInDOMTreeDeprecated() | 619 .computeVisibleSelectionInDOMTreeDeprecated() |
617 .isBaseFirst(); | 620 .isBaseFirst(); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 return nullptr; | 1140 return nullptr; |
1138 } | 1141 } |
1139 | 1142 |
1140 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { | 1143 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { |
1141 if (!m_imeAcceptEvents) | 1144 if (!m_imeAcceptEvents) |
1142 return nullptr; | 1145 return nullptr; |
1143 return focusedLocalFrameInWidget(); | 1146 return focusedLocalFrameInWidget(); |
1144 } | 1147 } |
1145 | 1148 |
1146 } // namespace blink | 1149 } // namespace blink |
OLD | NEW |