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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
860 // behaves as the editor but we want to return the actual element's bounds. | 860 // behaves as the editor but we want to return the actual element's bounds. |
861 // In practice, that means <textarea> and <input> controls that behave like | 861 // In practice, that means <textarea> and <input> controls that behave like |
862 // a text field. | 862 // a text field. |
863 Element* shadowHost = root->shadowHost(); | 863 Element* shadowHost = root->shadowHost(); |
864 if (shadowHost | 864 if (shadowHost |
865 && (isHTMLTextAreaElement(*shadowHost) | 865 && (isHTMLTextAreaElement(*shadowHost) |
866 || (isHTMLInputElement(*shadowHost) | 866 || (isHTMLInputElement(*shadowHost) |
867 && toHTMLInputElement(*shadowHost).isText()))) | 867 && toHTMLInputElement(*shadowHost).isText()))) |
868 root = shadowHost; | 868 root = shadowHost; |
869 | 869 |
870 IntRect boundingBox = root->pixelSnappedBoundingBox(); | 870 IntRect boundingBox = isHTMLHtmlElement(root) |
871 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize ()) | |
872 : root->pixelSnappedBoundingBox(); | |
873 | |
871 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox ); | 874 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox ); |
872 boundingBox.scale(pageScaleFactor()); | 875 boundingBox.scale(pageScaleFactor()); |
873 bounds = boundingBox; | 876 bounds = boundingBox; |
874 } | 877 } |
875 | 878 |
876 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) | 879 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
877 { | 880 { |
878 ASSERT((event.type == WebInputEvent::RawKeyDown) | 881 ASSERT((event.type == WebInputEvent::RawKeyDown) |
879 || (event.type == WebInputEvent::KeyDown) | 882 || (event.type == WebInputEvent::KeyDown) |
880 || (event.type == WebInputEvent::KeyUp)); | 883 || (event.type == WebInputEvent::KeyUp)); |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2185 | 2188 |
2186 IntRect scaledAnchor(frame->view()->contentsToWindow(anchor)); | 2189 IntRect scaledAnchor(frame->view()->contentsToWindow(anchor)); |
2187 IntRect scaledFocus(frame->view()->contentsToWindow(focus)); | 2190 IntRect scaledFocus(frame->view()->contentsToWindow(focus)); |
2188 scaledAnchor.scale(pageScaleFactor()); | 2191 scaledAnchor.scale(pageScaleFactor()); |
2189 scaledFocus.scale(pageScaleFactor()); | 2192 scaledFocus.scale(pageScaleFactor()); |
2190 anchor = scaledAnchor; | 2193 anchor = scaledAnchor; |
2191 focus = scaledFocus; | 2194 focus = scaledFocus; |
2192 | 2195 |
2193 if (!selection.selection().isBaseFirst()) | 2196 if (!selection.selection().isBaseFirst()) |
2194 std::swap(anchor, focus); | 2197 std::swap(anchor, focus); |
2198 | |
jochen (gone - plz use gerrit)
2014/04/14 07:12:16
unrelated change?
mlamouri (slow - plz ping)
2014/04/14 07:25:54
Removed.
| |
2195 return true; | 2199 return true; |
2196 } | 2200 } |
2197 | 2201 |
2198 InputMethodContext* WebViewImpl::inputMethodContext() | 2202 InputMethodContext* WebViewImpl::inputMethodContext() |
2199 { | 2203 { |
2200 if (!m_imeAcceptEvents) | 2204 if (!m_imeAcceptEvents) |
2201 return 0; | 2205 return 0; |
2202 | 2206 |
2203 LocalFrame* focusedFrame = toLocalFrame(focusedWebCoreFrame()); | 2207 LocalFrame* focusedFrame = toLocalFrame(focusedWebCoreFrame()); |
2204 if (!focusedFrame) | 2208 if (!focusedFrame) |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4008 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4012 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
4009 | 4013 |
4010 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4014 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4011 return false; | 4015 return false; |
4012 | 4016 |
4013 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4017 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4014 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4018 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
4015 } | 4019 } |
4016 | 4020 |
4017 } // namespace blink | 4021 } // namespace blink |
OLD | NEW |