| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 { | 209 { |
| 210 return WebElement(constUnwrap<Document>()->focusedElement()); | 210 return WebElement(constUnwrap<Document>()->focusedElement()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void WebDocument::insertStyleSheet(const WebString& sourceCode) | 213 void WebDocument::insertStyleSheet(const WebString& sourceCode) |
| 214 { | 214 { |
| 215 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); | 215 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); |
| 216 ASSERT(document); | 216 ASSERT(document); |
| 217 RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::cre
ate(CSSParserContext(*document, 0)); | 217 RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::cre
ate(CSSParserContext(*document, 0)); |
| 218 parsedSheet->parseString(sourceCode); | 218 parsedSheet->parseString(sourceCode); |
| 219 document->styleEngine().addAuthorSheet(parsedSheet); | 219 document->styleEngine().injectAuthorSheet(parsedSheet); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) | 222 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) |
| 223 { | 223 { |
| 224 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); | 224 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); |
| 225 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document); | 225 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document); |
| 226 if (!watch && webSelectors.isEmpty()) | 226 if (!watch && webSelectors.isEmpty()) |
| 227 return; | 227 return; |
| 228 Vector<String> selectors; | 228 Vector<String> selectors; |
| 229 selectors.append(webSelectors.data(), webSelectors.size()); | 229 selectors.append(webSelectors.data(), webSelectors.size()); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 m_private = elem; | 334 m_private = elem; |
| 335 return *this; | 335 return *this; |
| 336 } | 336 } |
| 337 | 337 |
| 338 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const | 338 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const |
| 339 { | 339 { |
| 340 return toDocument(m_private.get()); | 340 return toDocument(m_private.get()); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace blink | 343 } // namespace blink |
| OLD | NEW |