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 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2951 } | 2951 } |
2952 | 2952 |
2953 bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport) | 2953 bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport) |
2954 { | 2954 { |
2955 LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame
() | 2955 LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame
() |
2956 ? page()->deprecatedLocalMainFrame() : nullptr; | 2956 ? page()->deprecatedLocalMainFrame() : nullptr; |
2957 Element* element = focusedElement(); | 2957 Element* element = focusedElement(); |
2958 if (!frame || !frame->view() || !element) | 2958 if (!frame || !frame->view() || !element) |
2959 return false; | 2959 return false; |
2960 | 2960 |
2961 element->document().updateLayoutIgnorePendingStylesheets(); | 2961 element->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
2962 | 2962 |
2963 bool zoomInToLegibleScale = m_webSettings->autoZoomFocusedNodeToLegibleScale
() | 2963 bool zoomInToLegibleScale = m_webSettings->autoZoomFocusedNodeToLegibleScale
() |
2964 && !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds
(); | 2964 && !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds
(); |
2965 | 2965 |
2966 if (zoomInToLegibleScale) { | 2966 if (zoomInToLegibleScale) { |
2967 // When deciding whether to zoom in on a focused text box, we should dec
ide not to | 2967 // When deciding whether to zoom in on a focused text box, we should dec
ide not to |
2968 // zoom in if the user won't be able to zoom out. e.g if the textbox is
within a | 2968 // zoom in if the user won't be able to zoom out. e.g if the textbox is
within a |
2969 // touch-action: none container the user can't zoom back out. | 2969 // touch-action: none container the user can't zoom back out. |
2970 TouchAction action = TouchActionUtil::computeEffectiveTouchAction(*eleme
nt); | 2970 TouchAction action = TouchActionUtil::computeEffectiveTouchAction(*eleme
nt); |
2971 if (!(action & TouchActionPinchZoom)) | 2971 if (!(action & TouchActionPinchZoom)) |
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4534 { | 4534 { |
4535 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4535 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4536 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4536 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4537 if (!page()) | 4537 if (!page()) |
4538 return 1; | 4538 return 1; |
4539 | 4539 |
4540 return page()->deviceScaleFactor(); | 4540 return page()->deviceScaleFactor(); |
4541 } | 4541 } |
4542 | 4542 |
4543 } // namespace blink | 4543 } // namespace blink |
OLD | NEW |