| 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 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 if (!root) | 898 if (!root) |
| 899 return; | 899 return; |
| 900 | 900 |
| 901 // If the selection is inside a form control, the root will be a <div> that | 901 // If the selection is inside a form control, the root will be a <div> that |
| 902 // behaves as the editor but we want to return the actual element's bounds. | 902 // behaves as the editor but we want to return the actual element's bounds. |
| 903 // In practice, that means <textarea> and <input> controls that behave like | 903 // In practice, that means <textarea> and <input> controls that behave like |
| 904 // a text field. | 904 // a text field. |
| 905 Element* shadowHost = root->shadowHost(); | 905 Element* shadowHost = root->shadowHost(); |
| 906 if (shadowHost | 906 if (shadowHost |
| 907 && (isHTMLTextAreaElement(*shadowHost) | 907 && (isHTMLTextAreaElement(*shadowHost) |
| 908 || (isHTMLInputElement(*shadowHost) | 908 || (isHTMLInputElement(*shadowHost) && toHTMLInputElement(*shadowHos
t).isTextField()))) |
| 909 && toHTMLInputElement(*shadowHost).isText()))) | |
| 910 root = shadowHost; | 909 root = shadowHost; |
| 911 | 910 |
| 912 IntRect boundingBox = isHTMLHtmlElement(root) | 911 IntRect boundingBox = isHTMLHtmlElement(root) |
| 913 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize
()) | 912 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize
()) |
| 914 : root->pixelSnappedBoundingBox(); | 913 : root->pixelSnappedBoundingBox(); |
| 915 | 914 |
| 916 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox
); | 915 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox
); |
| 917 boundingBox.scale(pageScaleFactor()); | 916 boundingBox.scale(pageScaleFactor()); |
| 918 bounds = boundingBox; | 917 bounds = boundingBox; |
| 919 } | 918 } |
| (...skipping 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4291 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4290 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4292 | 4291 |
| 4293 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4292 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4294 return false; | 4293 return false; |
| 4295 | 4294 |
| 4296 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4295 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4297 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4296 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4298 } | 4297 } |
| 4299 | 4298 |
| 4300 } // namespace blink | 4299 } // namespace blink |
| OLD | NEW |