| 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 IntPoint VisualViewport::maximumScrollPosition() const | 558 IntPoint VisualViewport::maximumScrollPosition() const |
| 559 { | 559 { |
| 560 return flooredIntPoint(maximumScrollPositionDouble()); | 560 return flooredIntPoint(maximumScrollPositionDouble()); |
| 561 } | 561 } |
| 562 | 562 |
| 563 DoublePoint VisualViewport::maximumScrollPositionDouble() const | 563 DoublePoint VisualViewport::maximumScrollPositionDouble() const |
| 564 { | 564 { |
| 565 if (!mainFrame()) | 565 if (!mainFrame()) |
| 566 return IntPoint(); | 566 return IntPoint(); |
| 567 | 567 |
| 568 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/
422331. | 568 // TODO(bokan): We probably shouldn't be storing the bounds in a float. crbu
g.com/470718. |
| 569 FloatSize frameViewSize(contentsSize()); | 569 FloatSize frameViewSize(contentsSize()); |
| 570 | 570 |
| 571 if (m_topControlsAdjustment) { | 571 if (m_topControlsAdjustment) { |
| 572 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints(
).minimumScale; | 572 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints(
).minimumScale; |
| 573 frameViewSize.expand(0, m_topControlsAdjustment / minScale); | 573 frameViewSize.expand(0, m_topControlsAdjustment / minScale); |
| 574 } | 574 } |
| 575 | 575 |
| 576 frameViewSize.scale(m_scale); | 576 frameViewSize.scale(m_scale); |
| 577 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); | 577 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); |
| 578 | 578 |
| 579 FloatSize viewportSize(m_size); | 579 FloatSize viewportSize(m_size); |
| 580 viewportSize.expand(0, m_topControlsAdjustment); | 580 viewportSize.expand(0, ceilf(m_topControlsAdjustment)); |
| 581 | 581 |
| 582 FloatSize maxPosition = frameViewSize - viewportSize; | 582 FloatSize maxPosition = frameViewSize - viewportSize; |
| 583 maxPosition.scale(1 / m_scale); | 583 maxPosition.scale(1 / m_scale); |
| 584 return DoublePoint(maxPosition); | 584 return DoublePoint(maxPosition); |
| 585 } | 585 } |
| 586 | 586 |
| 587 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa
t scale) | 587 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa
t scale) |
| 588 { | 588 { |
| 589 if (!mainFrame() || !mainFrame()->view()) | 589 if (!mainFrame() || !mainFrame()->view()) |
| 590 return IntPoint(); | 590 return IntPoint(); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } else if (graphicsLayer == m_rootTransformLayer) { | 834 } else if (graphicsLayer == m_rootTransformLayer) { |
| 835 name = "Root Transform Layer"; | 835 name = "Root Transform Layer"; |
| 836 } else { | 836 } else { |
| 837 ASSERT_NOT_REACHED(); | 837 ASSERT_NOT_REACHED(); |
| 838 } | 838 } |
| 839 | 839 |
| 840 return name; | 840 return name; |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace blink | 843 } // namespace blink |
| OLD | NEW |