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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 else { | 904 else { |
905 ec = SyntaxError; | 905 ec = SyntaxError; |
906 return; | 906 return; |
907 } | 907 } |
908 | 908 |
909 pagination.gap = gap; | 909 pagination.gap = gap; |
910 pagination.pageLength = pageLength; | 910 pagination.pageLength = pageLength; |
911 page->setPagination(pagination); | 911 page->setPagination(pagination); |
912 } | 912 } |
913 | 913 |
914 String Internals::configurationForViewport(Document* document, float, int device
Width, int deviceHeight, int availableWidth, int availableHeight, ExceptionCode&
ec) | 914 String Internals::configurationForViewport(Document* document, float, int, int,
int availableWidth, int availableHeight, ExceptionCode& ec) |
915 { | 915 { |
916 if (!document || !document->page()) { | 916 if (!document || !document->page()) { |
917 ec = InvalidAccessError; | 917 ec = InvalidAccessError; |
918 return String(); | 918 return String(); |
919 } | 919 } |
920 Page* page = document->page(); | 920 Page* page = document->page(); |
921 | 921 |
922 // Update initial viewport size. | 922 // Update initial viewport size. |
923 IntSize initialViewportSize(availableWidth, availableHeight); | 923 IntSize initialViewportSize(availableWidth, availableHeight); |
924 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero()
, initialViewportSize)); | 924 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero()
, initialViewportSize)); |
925 document->styleResolver()->viewportStyleResolver()->resolve(); | 925 document->styleResolver()->viewportStyleResolver()->resolve(); |
926 | 926 |
927 ViewportArguments arguments = page->viewportArguments(); | 927 ViewportArguments arguments = page->viewportArguments(); |
928 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, Fl
oatSize(deviceWidth, deviceHeight), 980 /* defaultLayoutWidthForNonMobilePages *
/); | 928 PageScaleConstraints constraints = arguments.resolve(initialViewportSize); |
929 | 929 |
930 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); | 930 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); |
931 | 931 |
932 StringBuilder builder; | 932 StringBuilder builder; |
933 | 933 |
934 builder.appendLiteral("viewport size "); | 934 builder.appendLiteral("viewport size "); |
935 builder.append(String::number(constraints.layoutSize.width())); | 935 builder.append(String::number(constraints.layoutSize.width())); |
936 builder.append('x'); | 936 builder.append('x'); |
937 builder.append(String::number(constraints.layoutSize.height())); | 937 builder.append(String::number(constraints.layoutSize.height())); |
938 | 938 |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 | 2019 |
2020 RenderObject* renderer = select->renderer(); | 2020 RenderObject* renderer = select->renderer(); |
2021 if (!renderer->isMenuList()) | 2021 if (!renderer->isMenuList()) |
2022 return false; | 2022 return false; |
2023 | 2023 |
2024 RenderMenuList* menuList = toRenderMenuList(renderer); | 2024 RenderMenuList* menuList = toRenderMenuList(renderer); |
2025 return menuList->popupIsVisible(); | 2025 return menuList->popupIsVisible(); |
2026 } | 2026 } |
2027 | 2027 |
2028 } | 2028 } |
OLD | NEW |