OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 DCHECK(document); | 187 DCHECK(document); |
188 StyleSheetContents* parsedSheet = | 188 StyleSheetContents* parsedSheet = |
189 StyleSheetContents::create(CSSParserContext::create(*document)); | 189 StyleSheetContents::create(CSSParserContext::create(*document)); |
190 parsedSheet->parseString(sourceCode); | 190 parsedSheet->parseString(sourceCode); |
191 document->styleEngine().injectAuthorSheet(parsedSheet); | 191 document->styleEngine().injectAuthorSheet(parsedSheet); |
192 } | 192 } |
193 | 193 |
194 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) { | 194 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) { |
195 Document* document = unwrap<Document>(); | 195 Document* document = unwrap<Document>(); |
196 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document); | 196 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document); |
197 if (!watch && webSelectors.isEmpty()) | 197 if (!watch && webSelectors.empty()) |
198 return; | 198 return; |
199 Vector<String> selectors; | 199 Vector<String> selectors; |
200 selectors.append(webSelectors.data(), webSelectors.size()); | 200 selectors.append(webSelectors.data(), webSelectors.size()); |
201 CSSSelectorWatch::from(*document).watchCSSSelectors(selectors); | 201 CSSSelectorWatch::from(*document).watchCSSSelectors(selectors); |
202 } | 202 } |
203 | 203 |
204 WebReferrerPolicy WebDocument::getReferrerPolicy() const { | 204 WebReferrerPolicy WebDocument::getReferrerPolicy() const { |
205 return static_cast<WebReferrerPolicy>( | 205 return static_cast<WebReferrerPolicy>( |
206 constUnwrap<Document>()->getReferrerPolicy()); | 206 constUnwrap<Document>()->getReferrerPolicy()); |
207 } | 207 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 WebDocument& WebDocument::operator=(Document* elem) { | 296 WebDocument& WebDocument::operator=(Document* elem) { |
297 m_private = elem; | 297 m_private = elem; |
298 return *this; | 298 return *this; |
299 } | 299 } |
300 | 300 |
301 WebDocument::operator Document*() const { | 301 WebDocument::operator Document*() const { |
302 return toDocument(m_private.get()); | 302 return toDocument(m_private.get()); |
303 } | 303 } |
304 | 304 |
305 } // namespace blink | 305 } // namespace blink |
OLD | NEW |