OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 914 |
915 document->updateLayoutIgnorePendingStylesheets(); | 915 document->updateLayoutIgnorePendingStylesheets(); |
916 | 916 |
917 Page* page = document->page(); | 917 Page* page = document->page(); |
918 | 918 |
919 // Update initial viewport size. | 919 // Update initial viewport size. |
920 IntSize initialViewportSize(availableWidth, availableHeight); | 920 IntSize initialViewportSize(availableWidth, availableHeight); |
921 document->page()->deprecatedLocalMainFrame()->view()->setFrameRect(IntRect(I
ntPoint::zero(), initialViewportSize)); | 921 document->page()->deprecatedLocalMainFrame()->view()->setFrameRect(IntRect(I
ntPoint::zero(), initialViewportSize)); |
922 | 922 |
923 ViewportDescription description = page->viewportDescription(); | 923 ViewportDescription description = page->viewportDescription(); |
924 PageScaleConstraints constraints = description.resolve(initialViewportSize,
Length()); | 924 PageScaleConstraints constraints = description.resolve(FloatSize(initialView
portSize), Length()); |
925 | 925 |
926 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); | 926 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); |
927 constraints.resolveAutoInitialScale(); | 927 constraints.resolveAutoInitialScale(); |
928 | 928 |
929 StringBuilder builder; | 929 StringBuilder builder; |
930 | 930 |
931 builder.appendLiteral("viewport size "); | 931 builder.appendLiteral("viewport size "); |
932 builder.append(String::number(constraints.layoutSize.width())); | 932 builder.append(String::number(constraints.layoutSize.width())); |
933 builder.append('x'); | 933 builder.append('x'); |
934 builder.append(String::number(constraints.layoutSize.height())); | 934 builder.append(String::number(constraints.layoutSize.height())); |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2569 mediaElement->setNetworkState(static_cast<WebMediaPlayer::NetworkState>(stat
e)); | 2569 mediaElement->setNetworkState(static_cast<WebMediaPlayer::NetworkState>(stat
e)); |
2570 } | 2570 } |
2571 | 2571 |
2572 // TODO(liberato): remove once autoplay gesture override experiment concludes. | 2572 // TODO(liberato): remove once autoplay gesture override experiment concludes. |
2573 void Internals::triggerAutoplayViewportCheck(HTMLMediaElement* element) | 2573 void Internals::triggerAutoplayViewportCheck(HTMLMediaElement* element) |
2574 { | 2574 { |
2575 element->triggerAutoplayViewportCheckForTesting(); | 2575 element->triggerAutoplayViewportCheckForTesting(); |
2576 } | 2576 } |
2577 | 2577 |
2578 } // namespace blink | 2578 } // namespace blink |
OLD | NEW |