| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 WebElement WebDocument::GetElementById(const WebString& id) const { | 177 WebElement WebDocument::GetElementById(const WebString& id) const { |
| 178 return WebElement(ConstUnwrap<Document>()->getElementById(id)); | 178 return WebElement(ConstUnwrap<Document>()->getElementById(id)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 WebElement WebDocument::FocusedElement() const { | 181 WebElement WebDocument::FocusedElement() const { |
| 182 return WebElement(ConstUnwrap<Document>()->FocusedElement()); | 182 return WebElement(ConstUnwrap<Document>()->FocusedElement()); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void WebDocument::InsertStyleSheet(const WebString& source_code) { | 185 WebStyleSheetId WebDocument::InsertStyleSheet(const WebString& source_code) { |
| 186 Document* document = Unwrap<Document>(); | 186 Document* document = Unwrap<Document>(); |
| 187 DCHECK(document); | 187 DCHECK(document); |
| 188 StyleSheetContents* parsed_sheet = | 188 StyleSheetContents* parsed_sheet = |
| 189 StyleSheetContents::Create(CSSParserContext::Create(*document)); | 189 StyleSheetContents::Create(CSSParserContext::Create(*document)); |
| 190 parsed_sheet->ParseString(source_code); | 190 parsed_sheet->ParseString(source_code); |
| 191 document->GetStyleEngine().InjectAuthorSheet(parsed_sheet); | 191 return document->GetStyleEngine().InjectAuthorSheet(parsed_sheet); |
| 192 } |
| 193 |
| 194 void WebDocument::RemoveInsertedStyleSheet(WebStyleSheetId stylesheet_id) { |
| 195 Unwrap<Document>()->GetStyleEngine().RemoveInjectedAuthorSheet(stylesheet_id); |
| 192 } | 196 } |
| 193 | 197 |
| 194 void WebDocument::WatchCSSSelectors(const WebVector<WebString>& web_selectors) { | 198 void WebDocument::WatchCSSSelectors(const WebVector<WebString>& web_selectors) { |
| 195 Document* document = Unwrap<Document>(); | 199 Document* document = Unwrap<Document>(); |
| 196 CSSSelectorWatch* watch = CSSSelectorWatch::FromIfExists(*document); | 200 CSSSelectorWatch* watch = CSSSelectorWatch::FromIfExists(*document); |
| 197 if (!watch && web_selectors.empty()) | 201 if (!watch && web_selectors.empty()) |
| 198 return; | 202 return; |
| 199 Vector<String> selectors; | 203 Vector<String> selectors; |
| 200 selectors.Append(web_selectors.Data(), web_selectors.size()); | 204 selectors.Append(web_selectors.Data(), web_selectors.size()); |
| 201 CSSSelectorWatch::From(*document).WatchCSSSelectors(selectors); | 205 CSSSelectorWatch::From(*document).WatchCSSSelectors(selectors); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 WebDocument& WebDocument::operator=(Document* elem) { | 300 WebDocument& WebDocument::operator=(Document* elem) { |
| 297 private_ = elem; | 301 private_ = elem; |
| 298 return *this; | 302 return *this; |
| 299 } | 303 } |
| 300 | 304 |
| 301 WebDocument::operator Document*() const { | 305 WebDocument::operator Document*() const { |
| 302 return ToDocument(private_.Get()); | 306 return ToDocument(private_.Get()); |
| 303 } | 307 } |
| 304 | 308 |
| 305 } // namespace blink | 309 } // namespace blink |
| OLD | NEW |