OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 } | 2939 } |
2940 | 2940 |
2941 bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport) | 2941 bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport) |
2942 { | 2942 { |
2943 LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame
() | 2943 LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame
() |
2944 ? page()->deprecatedLocalMainFrame() : nullptr; | 2944 ? page()->deprecatedLocalMainFrame() : nullptr; |
2945 Element* element = focusedElement(); | 2945 Element* element = focusedElement(); |
2946 if (!frame || !frame->view() || !element) | 2946 if (!frame || !frame->view() || !element) |
2947 return false; | 2947 return false; |
2948 | 2948 |
2949 element->document().updateLayoutIgnorePendingStylesheets(); | 2949 element->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
2950 | 2950 |
2951 bool zoomInToLegibleScale = m_webSettings->autoZoomFocusedNodeToLegibleScale
() | 2951 bool zoomInToLegibleScale = m_webSettings->autoZoomFocusedNodeToLegibleScale
() |
2952 && !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds
(); | 2952 && !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds
(); |
2953 | 2953 |
2954 if (zoomInToLegibleScale) { | 2954 if (zoomInToLegibleScale) { |
2955 // When deciding whether to zoom in on a focused text box, we should dec
ide not to | 2955 // When deciding whether to zoom in on a focused text box, we should dec
ide not to |
2956 // zoom in if the user won't be able to zoom out. e.g if the textbox is
within a | 2956 // zoom in if the user won't be able to zoom out. e.g if the textbox is
within a |
2957 // touch-action: none container the user can't zoom back out. | 2957 // touch-action: none container the user can't zoom back out. |
2958 TouchAction action = TouchActionUtil::computeEffectiveTouchAction(*eleme
nt); | 2958 TouchAction action = TouchActionUtil::computeEffectiveTouchAction(*eleme
nt); |
2959 if (!(action & TouchActionPinchZoom)) | 2959 if (!(action & TouchActionPinchZoom)) |
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4524 { | 4524 { |
4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4527 if (!page()) | 4527 if (!page()) |
4528 return 1; | 4528 return 1; |
4529 | 4529 |
4530 return page()->deviceScaleFactor(); | 4530 return page()->deviceScaleFactor(); |
4531 } | 4531 } |
4532 | 4532 |
4533 } // namespace blink | 4533 } // namespace blink |
OLD | NEW |