OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (!document) | 246 if (!document) |
247 return true; | 247 return true; |
248 if (document->securityOrigin()->canRequest(baseURL)) | 248 if (document->securityOrigin()->canRequest(baseURL)) |
249 return true; | 249 return true; |
250 return false; | 250 return false; |
251 } | 251 } |
252 | 252 |
253 PassRefPtr<CSSRuleList> CSSStyleSheet::rules() | 253 PassRefPtr<CSSRuleList> CSSStyleSheet::rules() |
254 { | 254 { |
255 if (!canAccessRules()) | 255 if (!canAccessRules()) |
256 return 0; | 256 return nullptr; |
257 // IE behavior. | 257 // IE behavior. |
258 RefPtr<StaticCSSRuleList> nonCharsetRules = StaticCSSRuleList::create(); | 258 RefPtr<StaticCSSRuleList> nonCharsetRules = StaticCSSRuleList::create(); |
259 unsigned ruleCount = length(); | 259 unsigned ruleCount = length(); |
260 for (unsigned i = 0; i < ruleCount; ++i) { | 260 for (unsigned i = 0; i < ruleCount; ++i) { |
261 CSSRule* rule = item(i); | 261 CSSRule* rule = item(i); |
262 if (rule->type() == CSSRule::CHARSET_RULE) | 262 if (rule->type() == CSSRule::CHARSET_RULE) |
263 continue; | 263 continue; |
264 nonCharsetRules->rules().append(rule); | 264 nonCharsetRules->rules().append(rule); |
265 } | 265 } |
266 return nonCharsetRules.release(); | 266 return nonCharsetRules.release(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 int CSSStyleSheet::addRule(const String& selector, const String& style, Exceptio
nState& exceptionState) | 338 int CSSStyleSheet::addRule(const String& selector, const String& style, Exceptio
nState& exceptionState) |
339 { | 339 { |
340 return addRule(selector, style, length(), exceptionState); | 340 return addRule(selector, style, length(), exceptionState); |
341 } | 341 } |
342 | 342 |
343 | 343 |
344 PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules() | 344 PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules() |
345 { | 345 { |
346 if (!canAccessRules()) | 346 if (!canAccessRules()) |
347 return 0; | 347 return nullptr; |
348 if (!m_ruleListCSSOMWrapper) | 348 if (!m_ruleListCSSOMWrapper) |
349 m_ruleListCSSOMWrapper = adoptPtr(new StyleSheetCSSRuleList(this)); | 349 m_ruleListCSSOMWrapper = adoptPtr(new StyleSheetCSSRuleList(this)); |
350 return m_ruleListCSSOMWrapper.get(); | 350 return m_ruleListCSSOMWrapper.get(); |
351 } | 351 } |
352 | 352 |
353 String CSSStyleSheet::href() const | 353 String CSSStyleSheet::href() const |
354 { | 354 { |
355 return m_contents->originalURL(); | 355 return m_contents->originalURL(); |
356 } | 356 } |
357 | 357 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return m_loadCompleted; | 400 return m_loadCompleted; |
401 } | 401 } |
402 | 402 |
403 void CSSStyleSheet::startLoadingDynamicSheet() | 403 void CSSStyleSheet::startLoadingDynamicSheet() |
404 { | 404 { |
405 m_loadCompleted = false; | 405 m_loadCompleted = false; |
406 m_ownerNode->startLoadingDynamicSheet(); | 406 m_ownerNode->startLoadingDynamicSheet(); |
407 } | 407 } |
408 | 408 |
409 } | 409 } |
OLD | NEW |