Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: Source/web/WebDocument.cpp

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Add a test for watching dynamic attribute changes Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 #include "WebDocumentType.h" 38 #include "WebDocumentType.h"
39 #include "WebElement.h" 39 #include "WebElement.h"
40 #include "WebFormElement.h" 40 #include "WebFormElement.h"
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/ExceptionState.h" 44 #include "bindings/v8/ExceptionState.h"
45 #include "core/accessibility/AXObjectCache.h" 45 #include "core/accessibility/AXObjectCache.h"
46 #include "core/css/CSSParserMode.h" 46 #include "core/css/CSSParserMode.h"
47 #include "core/css/StyleSheetContents.h" 47 #include "core/css/StyleSheetContents.h"
48 #include "core/dom/CSSSelectorWatch.h"
48 #include "core/dom/Document.h" 49 #include "core/dom/Document.h"
49 #include "core/dom/DocumentStyleSheetCollection.h" 50 #include "core/dom/DocumentStyleSheetCollection.h"
50 #include "core/dom/DocumentType.h" 51 #include "core/dom/DocumentType.h"
51 #include "core/dom/Element.h" 52 #include "core/dom/Element.h"
52 #include "core/dom/FullscreenElementStack.h" 53 #include "core/dom/FullscreenElementStack.h"
53 #include "core/dom/NodeList.h" 54 #include "core/dom/NodeList.h"
54 #include "core/html/HTMLAllCollection.h" 55 #include "core/html/HTMLAllCollection.h"
55 #include "core/html/HTMLBodyElement.h" 56 #include "core/html/HTMLBodyElement.h"
56 #include "core/html/HTMLCollection.h" 57 #include "core/html/HTMLCollection.h"
57 #include "core/html/HTMLElement.h" 58 #include "core/html/HTMLElement.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 203
203 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document .get()); 204 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document .get());
204 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel); 205 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel);
205 parsedSheet->parseString(sourceCode); 206 parsedSheet->parseString(sourceCode);
206 if (parsedSheet->isUserStyleSheet()) 207 if (parsedSheet->isUserStyleSheet())
207 document->styleSheetCollection()->addUserSheet(parsedSheet); 208 document->styleSheetCollection()->addUserSheet(parsedSheet);
208 else 209 else
209 document->styleSheetCollection()->addAuthorSheet(parsedSheet); 210 document->styleSheetCollection()->addAuthorSheet(parsedSheet);
210 } 211 }
211 212
213 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors)
214 {
215 RefPtr<Document> document = unwrap<Document>();
216 Vector<String> selectors;
217 selectors.append(webSelectors.data(), webSelectors.size());
218 CSSSelectorWatch::from(document.get())->watchCSSSelectors(selectors);
219 }
220
212 void WebDocument::cancelFullScreen() 221 void WebDocument::cancelFullScreen()
213 { 222 {
214 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist s(unwrap<Document>())) 223 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist s(unwrap<Document>()))
215 fullscreen->webkitCancelFullScreen(); 224 fullscreen->webkitCancelFullScreen();
216 } 225 }
217 226
218 WebElement WebDocument::fullScreenElement() const 227 WebElement WebDocument::fullScreenElement() const
219 { 228 {
220 Element* fullScreenElement = 0; 229 Element* fullScreenElement = 0;
221 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist s(const_cast<WebDocument*>(this)->unwrap<Document>())) 230 if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExist s(const_cast<WebDocument*>(this)->unwrap<Document>()))
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 m_private = elem; 295 m_private = elem;
287 return *this; 296 return *this;
288 } 297 }
289 298
290 WebDocument::operator PassRefPtr<Document>() const 299 WebDocument::operator PassRefPtr<Document>() const
291 { 300 {
292 return toDocument(m_private.get()); 301 return toDocument(m_private.get());
293 } 302 }
294 303
295 } // namespace WebKit 304 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698