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 WebNode WebDocument::focusedNode() const | 187 WebNode WebDocument::focusedNode() const |
188 { | 188 { |
189 return WebNode(constUnwrap<Document>()->focusedNode()); | 189 return WebNode(constUnwrap<Document>()->focusedNode()); |
190 } | 190 } |
191 | 191 |
192 WebDocumentType WebDocument::doctype() const | 192 WebDocumentType WebDocument::doctype() const |
193 { | 193 { |
194 return WebDocumentType(constUnwrap<Document>()->doctype()); | 194 return WebDocumentType(constUnwrap<Document>()->doctype()); |
195 } | 195 } |
196 | 196 |
197 void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLev
el) | 197 void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLev
el styleLevel) |
198 { | 198 { |
199 RefPtr<Document> document = unwrap<Document>(); | 199 RefPtr<Document> document = unwrap<Document>(); |
200 | 200 |
201 // FIXME: We currently ignore the passed in UserStyleLevel. http://crbug.com
/162096 | |
202 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document
.get()); | 201 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document
.get()); |
203 parsedSheet->setIsUserStyleSheet(true); | 202 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel); |
204 parsedSheet->parseString(sourceCode); | 203 parsedSheet->parseString(sourceCode); |
205 document->styleSheetCollection()->addUserSheet(parsedSheet.release()); | 204 if (parsedSheet->isUserStyleSheet()) |
| 205 document->styleSheetCollection()->addUserSheet(parsedSheet); |
| 206 else |
| 207 document->styleSheetCollection()->addAuthorSheet(parsedSheet); |
206 } | 208 } |
207 | 209 |
208 void WebDocument::cancelFullScreen() | 210 void WebDocument::cancelFullScreen() |
209 { | 211 { |
210 #if ENABLE(FULLSCREEN_API) | 212 #if ENABLE(FULLSCREEN_API) |
211 unwrap<Document>()->webkitCancelFullScreen(); | 213 unwrap<Document>()->webkitCancelFullScreen(); |
212 #endif | 214 #endif |
213 } | 215 } |
214 | 216 |
215 WebElement WebDocument::fullScreenElement() const | 217 WebElement WebDocument::fullScreenElement() const |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 m_private = elem; | 288 m_private = elem; |
287 return *this; | 289 return *this; |
288 } | 290 } |
289 | 291 |
290 WebDocument::operator PassRefPtr<Document>() const | 292 WebDocument::operator PassRefPtr<Document>() const |
291 { | 293 { |
292 return static_cast<Document*>(m_private.get()); | 294 return static_cast<Document*>(m_private.get()); |
293 } | 295 } |
294 | 296 |
295 } // namespace WebKit | 297 } // namespace WebKit |
OLD | NEW |