Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 } | 769 } |
| 770 | 770 |
| 771 bool VisualViewport::shouldDisableDesktopWorkarounds() const { | 771 bool VisualViewport::shouldDisableDesktopWorkarounds() const { |
| 772 if (!mainFrame() || !mainFrame()->view()) | 772 if (!mainFrame() || !mainFrame()->view()) |
| 773 return false; | 773 return false; |
| 774 | 774 |
| 775 if (!mainFrame()->settings()->viewportEnabled()) | 775 if (!mainFrame()->settings()->viewportEnabled()) |
| 776 return false; | 776 return false; |
| 777 | 777 |
| 778 // A document is considered adapted to small screen UAs if one of these holds: | 778 // A document is considered adapted to small screen UAs if one of these holds: |
| 779 // 1. The author specified viewport has a constrained width that is equal to | 779 // 1. The author specified viewport has a constrained width that is smaller or |
| 780 // the initial viewport width. | 780 // equal to the initial viewport width. |
| 781 // 2. The author has disabled viewport zoom. | 781 // 2. The author has disabled viewport zoom. |
| 782 const PageScaleConstraints& constraints = | 782 const PageScaleConstraints& constraints = |
| 783 frameHost().pageScaleConstraintsSet().pageDefinedConstraints(); | 783 frameHost().pageScaleConstraintsSet().pageDefinedConstraints(); |
| 784 | 784 |
| 785 return mainFrame()->view()->layoutSize().width() == m_size.width() || | 785 return mainFrame()->view()->layoutSize().width() <= m_size.width() || |
|
aelias_OOO_until_Jul13
2016/10/24 21:48:59
Hmm, I think we should decouple this from the deta
wychen
2016/10/24 23:18:52
Done.
| |
| 786 (constraints.minimumScale == constraints.maximumScale && | 786 (constraints.minimumScale == constraints.maximumScale && |
| 787 constraints.minimumScale != -1); | 787 constraints.minimumScale != -1); |
| 788 } | 788 } |
| 789 | 789 |
| 790 CompositorAnimationTimeline* VisualViewport::compositorAnimationTimeline() | 790 CompositorAnimationTimeline* VisualViewport::compositorAnimationTimeline() |
| 791 const { | 791 const { |
| 792 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator(); | 792 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator(); |
| 793 return c ? c->compositorAnimationTimeline() : nullptr; | 793 return c ? c->compositorAnimationTimeline() : nullptr; |
| 794 } | 794 } |
| 795 | 795 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 823 } else if (graphicsLayer == m_rootTransformLayer.get()) { | 823 } else if (graphicsLayer == m_rootTransformLayer.get()) { |
| 824 name = "Root Transform Layer"; | 824 name = "Root Transform Layer"; |
| 825 } else { | 825 } else { |
| 826 ASSERT_NOT_REACHED(); | 826 ASSERT_NOT_REACHED(); |
| 827 } | 827 } |
| 828 | 828 |
| 829 return name; | 829 return name; |
| 830 } | 830 } |
| 831 | 831 |
| 832 } // namespace blink | 832 } // namespace blink |
| OLD | NEW |