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 30 matching lines...) Expand all Loading... |
41 #include "WebFrameImpl.h" | 41 #include "WebFrameImpl.h" |
42 #include "WebNodeCollection.h" | 42 #include "WebNodeCollection.h" |
43 #include "WebNodeList.h" | 43 #include "WebNodeList.h" |
44 #include "bindings/v8/Dictionary.h" | 44 #include "bindings/v8/Dictionary.h" |
45 #include "bindings/v8/ExceptionState.h" | 45 #include "bindings/v8/ExceptionState.h" |
46 #include "bindings/v8/ScriptState.h" | 46 #include "bindings/v8/ScriptState.h" |
47 #include "bindings/v8/ScriptValue.h" | 47 #include "bindings/v8/ScriptValue.h" |
48 #include "core/accessibility/AXObjectCache.h" | 48 #include "core/accessibility/AXObjectCache.h" |
49 #include "core/css/CSSParserMode.h" | 49 #include "core/css/CSSParserMode.h" |
50 #include "core/css/StyleSheetContents.h" | 50 #include "core/css/StyleSheetContents.h" |
| 51 #include "core/dom/CSSSelectorWatch.h" |
51 #include "core/dom/Document.h" | 52 #include "core/dom/Document.h" |
52 #include "core/dom/DocumentType.h" | 53 #include "core/dom/DocumentType.h" |
53 #include "core/dom/Element.h" | 54 #include "core/dom/Element.h" |
54 #include "core/dom/FullscreenElementStack.h" | 55 #include "core/dom/FullscreenElementStack.h" |
55 #include "core/dom/NodeList.h" | 56 #include "core/dom/NodeList.h" |
56 #include "core/dom/StyleSheetCollections.h" | 57 #include "core/dom/StyleSheetCollections.h" |
57 #include "core/html/HTMLAllCollection.h" | 58 #include "core/html/HTMLAllCollection.h" |
58 #include "core/html/HTMLBodyElement.h" | 59 #include "core/html/HTMLBodyElement.h" |
59 #include "core/html/HTMLCollection.h" | 60 #include "core/html/HTMLCollection.h" |
60 #include "core/html/HTMLElement.h" | 61 #include "core/html/HTMLElement.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 207 |
207 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document
.get()); | 208 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document
.get()); |
208 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel); | 209 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel); |
209 parsedSheet->parseString(sourceCode); | 210 parsedSheet->parseString(sourceCode); |
210 if (parsedSheet->isUserStyleSheet()) | 211 if (parsedSheet->isUserStyleSheet()) |
211 document->styleSheetCollections()->addUserSheet(parsedSheet); | 212 document->styleSheetCollections()->addUserSheet(parsedSheet); |
212 else | 213 else |
213 document->styleSheetCollections()->addAuthorSheet(parsedSheet); | 214 document->styleSheetCollections()->addAuthorSheet(parsedSheet); |
214 } | 215 } |
215 | 216 |
| 217 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) |
| 218 { |
| 219 RefPtr<Document> document = unwrap<Document>(); |
| 220 Vector<String> selectors; |
| 221 selectors.append(webSelectors.data(), webSelectors.size()); |
| 222 CSSSelectorWatch::from(document.get())->watchCSSSelectors(selectors); |
| 223 } |
| 224 |
216 void WebDocument::cancelFullScreen() | 225 void WebDocument::cancelFullScreen() |
217 { | 226 { |
218 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(unwrap<Document>())) | 227 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(unwrap<Document>())) |
219 fullscreen->webkitCancelFullScreen(); | 228 fullscreen->webkitCancelFullScreen(); |
220 } | 229 } |
221 | 230 |
222 WebElement WebDocument::fullScreenElement() const | 231 WebElement WebDocument::fullScreenElement() const |
223 { | 232 { |
224 Element* fullScreenElement = 0; | 233 Element* fullScreenElement = 0; |
225 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(const_cast<WebDocument*>(this)->unwrap<Document>())) | 234 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist
s(const_cast<WebDocument*>(this)->unwrap<Document>())) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 m_private = elem; | 311 m_private = elem; |
303 return *this; | 312 return *this; |
304 } | 313 } |
305 | 314 |
306 WebDocument::operator PassRefPtr<Document>() const | 315 WebDocument::operator PassRefPtr<Document>() const |
307 { | 316 { |
308 return toDocument(m_private.get()); | 317 return toDocument(m_private.get()); |
309 } | 318 } |
310 | 319 |
311 } // namespace WebKit | 320 } // namespace WebKit |
OLD | NEW |