OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "public/web/WebFrame.h" | 33 #include "public/web/WebFrame.h" |
34 | 34 |
35 #include "SkBitmap.h" | 35 #include "SkBitmap.h" |
36 #include "SkCanvas.h" | 36 #include "SkCanvas.h" |
37 #include "core/UserAgentStyleSheets.h" | |
38 #include "core/clipboard/DataTransfer.h" | 37 #include "core/clipboard/DataTransfer.h" |
39 #include "core/css/StyleSheetContents.h" | 38 #include "core/css/StyleSheetContents.h" |
40 #include "core/css/resolver/StyleResolver.h" | 39 #include "core/css/resolver/StyleResolver.h" |
41 #include "core/css/resolver/ViewportStyleResolver.h" | 40 #include "core/css/resolver/ViewportStyleResolver.h" |
42 #include "core/dom/DocumentMarkerController.h" | 41 #include "core/dom/DocumentMarkerController.h" |
43 #include "core/dom/FullscreenElementStack.h" | 42 #include "core/dom/FullscreenElementStack.h" |
44 #include "core/dom/Range.h" | 43 #include "core/dom/Range.h" |
45 #include "core/editing/Editor.h" | 44 #include "core/editing/Editor.h" |
46 #include "core/editing/FrameSelection.h" | 45 #include "core/editing/FrameSelection.h" |
47 #include "core/editing/SpellChecker.h" | 46 #include "core/editing/SpellChecker.h" |
(...skipping 14 matching lines...) Expand all Loading... |
62 #include "core/rendering/RenderView.h" | 61 #include "core/rendering/RenderView.h" |
63 #include "core/rendering/compositing/RenderLayerCompositor.h" | 62 #include "core/rendering/compositing/RenderLayerCompositor.h" |
64 #include "platform/DragImage.h" | 63 #include "platform/DragImage.h" |
65 #include "platform/RuntimeEnabledFeatures.h" | 64 #include "platform/RuntimeEnabledFeatures.h" |
66 #include "platform/UserGestureIndicator.h" | 65 #include "platform/UserGestureIndicator.h" |
67 #include "platform/geometry/FloatRect.h" | 66 #include "platform/geometry/FloatRect.h" |
68 #include "platform/network/ResourceError.h" | 67 #include "platform/network/ResourceError.h" |
69 #include "platform/scroll/ScrollbarTheme.h" | 68 #include "platform/scroll/ScrollbarTheme.h" |
70 #include "platform/weborigin/SchemeRegistry.h" | 69 #include "platform/weborigin/SchemeRegistry.h" |
71 #include "public/platform/Platform.h" | 70 #include "public/platform/Platform.h" |
| 71 #include "public/platform/WebData.h" |
72 #include "public/platform/WebFloatRect.h" | 72 #include "public/platform/WebFloatRect.h" |
73 #include "public/platform/WebSelectionBound.h" | 73 #include "public/platform/WebSelectionBound.h" |
74 #include "public/platform/WebThread.h" | 74 #include "public/platform/WebThread.h" |
75 #include "public/platform/WebURL.h" | 75 #include "public/platform/WebURL.h" |
76 #include "public/platform/WebURLResponse.h" | 76 #include "public/platform/WebURLResponse.h" |
77 #include "public/platform/WebUnitTestSupport.h" | 77 #include "public/platform/WebUnitTestSupport.h" |
78 #include "public/web/WebDataSource.h" | 78 #include "public/web/WebDataSource.h" |
79 #include "public/web/WebDocument.h" | 79 #include "public/web/WebDocument.h" |
80 #include "public/web/WebFindOptions.h" | 80 #include "public/web/WebFindOptions.h" |
81 #include "public/web/WebFormElement.h" | 81 #include "public/web/WebFormElement.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 void registerMockedChromeURLLoad(const std::string& fileName) | 149 void registerMockedChromeURLLoad(const std::string& fileName) |
150 { | 150 { |
151 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); | 151 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); |
152 } | 152 } |
153 | 153 |
154 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) | 154 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) |
155 { | 155 { |
156 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS
heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0)); | 156 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS
heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0)); |
157 styleSheet->parseString(String(blink::viewportAndroidCss, sizeof(blink::
viewportAndroidCss))); | 157 const blink::WebData& viewportAndroidCssResource = blink::Platform::curr
ent()->loadResource("viewportAndroid.css"); |
| 158 styleSheet->parseString(String(viewportAndroidCssResource.data(), viewpo
rtAndroidCssResource.size())); |
158 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create(); | 159 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create(); |
159 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator(
"screen")); | 160 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator(
"screen")); |
160 | 161 |
161 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); | 162 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); |
162 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin); | 163 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin); |
163 document->ensureStyleResolver().viewportStyleResolver()->resolve(); | 164 document->ensureStyleResolver().viewportStyleResolver()->resolve(); |
164 } | 165 } |
165 | 166 |
166 static void configueCompositingWebView(WebSettings* settings) | 167 static void configueCompositingWebView(WebSettings* settings) |
167 { | 168 { |
(...skipping 5753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5921 | 5922 |
5922 client.reset(); | 5923 client.reset(); |
5923 // Try to load the request with cross origin access. Should succeed. | 5924 // Try to load the request with cross origin access. Should succeed. |
5924 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; | 5925 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; |
5925 blink::DocumentThreadableLoader::loadResourceSynchronously( | 5926 blink::DocumentThreadableLoader::loadResourceSynchronously( |
5926 *frame->document(), blink::ResourceRequest(resourceUrl), client, options
, resourceLoaderOptions); | 5927 *frame->document(), blink::ResourceRequest(resourceUrl), client, options
, resourceLoaderOptions); |
5927 EXPECT_FALSE(client.failed()); | 5928 EXPECT_FALSE(client.failed()); |
5928 } | 5929 } |
5929 | 5930 |
5930 } // namespace | 5931 } // namespace |
OLD | NEW |