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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 IntPoint VisualViewport::maximumScrollPosition() const | 538 IntPoint VisualViewport::maximumScrollPosition() const |
539 { | 539 { |
540 return flooredIntPoint(maximumScrollPositionDouble()); | 540 return flooredIntPoint(maximumScrollPositionDouble()); |
541 } | 541 } |
542 | 542 |
543 DoublePoint VisualViewport::maximumScrollPositionDouble() const | 543 DoublePoint VisualViewport::maximumScrollPositionDouble() const |
544 { | 544 { |
545 if (!mainFrame()) | 545 if (!mainFrame()) |
546 return IntPoint(); | 546 return IntPoint(); |
547 | 547 |
548 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/
422331. | 548 // TODO(bokan): We probably shouldn't be storing the bounds in a float. crbu
g.com/470718. |
549 FloatSize frameViewSize(contentsSize()); | 549 FloatSize frameViewSize(contentsSize()); |
550 | 550 |
551 if (m_topControlsAdjustment) { | 551 if (m_topControlsAdjustment) { |
552 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints(
).minimumScale; | 552 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints(
).minimumScale; |
553 frameViewSize.expand(0, m_topControlsAdjustment / minScale); | 553 frameViewSize.expand(0, m_topControlsAdjustment / minScale); |
554 } | 554 } |
555 | 555 |
556 frameViewSize.scale(m_scale); | 556 frameViewSize.scale(m_scale); |
557 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); | 557 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); |
558 | 558 |
559 FloatSize viewportSize(m_size); | 559 FloatSize viewportSize(m_size); |
560 viewportSize.expand(0, m_topControlsAdjustment); | 560 viewportSize.expand(0, ceilf(m_topControlsAdjustment)); |
561 | 561 |
562 FloatSize maxPosition = frameViewSize - viewportSize; | 562 FloatSize maxPosition = frameViewSize - viewportSize; |
563 maxPosition.scale(1 / m_scale); | 563 maxPosition.scale(1 / m_scale); |
564 return DoublePoint(maxPosition); | 564 return DoublePoint(maxPosition); |
565 } | 565 } |
566 | 566 |
567 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa
t scale) | 567 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa
t scale) |
568 { | 568 { |
569 if (!mainFrame() || !mainFrame()->view()) | 569 if (!mainFrame() || !mainFrame()->view()) |
570 return IntPoint(); | 570 return IntPoint(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 } else if (graphicsLayer == m_rootTransformLayer) { | 814 } else if (graphicsLayer == m_rootTransformLayer) { |
815 name = "Root Transform Layer"; | 815 name = "Root Transform Layer"; |
816 } else { | 816 } else { |
817 ASSERT_NOT_REACHED(); | 817 ASSERT_NOT_REACHED(); |
818 } | 818 } |
819 | 819 |
820 return name; | 820 return name; |
821 } | 821 } |
822 | 822 |
823 } // namespace blink | 823 } // namespace blink |
OLD | NEW |