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 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4008 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4011 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4009 | 4012 |
4010 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4013 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4011 return false; | 4014 return false; |
4012 | 4015 |
4013 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4016 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4014 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4017 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4015 } | 4018 } |
4016 | 4019 |
4017 } // namespace blink | 4020 } // namespace blink |
OLD | NEW |