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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 IntPoint VisualViewport::maximumScrollPosition() const | 467 IntPoint VisualViewport::maximumScrollPosition() const |
468 { | 468 { |
469 return flooredIntPoint(maximumScrollPositionDouble()); | 469 return flooredIntPoint(maximumScrollPositionDouble()); |
470 } | 470 } |
471 | 471 |
472 DoublePoint VisualViewport::maximumScrollPositionDouble() const | 472 DoublePoint VisualViewport::maximumScrollPositionDouble() const |
473 { | 473 { |
474 if (!mainFrame()) | 474 if (!mainFrame()) |
475 return IntPoint(); | 475 return IntPoint(); |
476 | 476 |
477 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/ 422331. | 477 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/ 422331. |
majidvp
2016/04/01 17:09:36
The actual bug for this TODO is marked as WontFix.
bokan
2016/04/05 17:11:40
Good catch, this was the wrong bug. Updated.
| |
478 FloatSize frameViewSize(contentsSize()); | 478 FloatSize frameViewSize(contentsSize()); |
479 | 479 |
480 if (m_topControlsAdjustment) { | 480 if (m_topControlsAdjustment) { |
481 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints( ).minimumScale; | 481 float minScale = frameHost().pageScaleConstraintsSet().finalConstraints( ).minimumScale; |
482 frameViewSize.expand(0, m_topControlsAdjustment / minScale); | 482 frameViewSize.expand(0, m_topControlsAdjustment / minScale); |
483 } | 483 } |
484 | 484 |
485 frameViewSize.scale(m_scale); | 485 frameViewSize.scale(m_scale); |
486 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); | 486 frameViewSize = FloatSize(flooredIntSize(frameViewSize)); |
487 | 487 |
488 FloatSize viewportSize(m_size); | 488 FloatSize viewportSize(m_size); |
489 viewportSize.expand(0, m_topControlsAdjustment); | 489 viewportSize.expand(0, ceilf(m_topControlsAdjustment)); |
majidvp
2016/04/01 17:09:36
Can you point out where in CC we are ceiling the t
bokan
2016/04/05 17:11:40
https://code.google.com/p/chromium/codesearch#chro
| |
490 | 490 |
491 FloatSize maxPosition = frameViewSize - viewportSize; | 491 FloatSize maxPosition = frameViewSize - viewportSize; |
492 maxPosition.scale(1 / m_scale); | 492 maxPosition.scale(1 / m_scale); |
493 return DoublePoint(maxPosition); | 493 return DoublePoint(maxPosition); |
494 } | 494 } |
495 | 495 |
496 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa t scale) | 496 IntPoint VisualViewport::clampDocumentOffsetAtScale(const IntPoint& offset, floa t scale) |
497 { | 497 { |
498 if (!mainFrame() || !mainFrame()->view()) | 498 if (!mainFrame() || !mainFrame()->view()) |
499 return IntPoint(); | 499 return IntPoint(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 } else if (graphicsLayer == m_rootTransformLayer) { | 743 } else if (graphicsLayer == m_rootTransformLayer) { |
744 name = "Root Transform Layer"; | 744 name = "Root Transform Layer"; |
745 } else { | 745 } else { |
746 ASSERT_NOT_REACHED(); | 746 ASSERT_NOT_REACHED(); |
747 } | 747 } |
748 | 748 |
749 return name; | 749 return name; |
750 } | 750 } |
751 | 751 |
752 } // namespace blink | 752 } // namespace blink |
OLD | NEW |