| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 m_sourceURL = ""; | 1426 m_sourceURL = ""; |
| 1427 return m_sourceURL; | 1427 return m_sourceURL; |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 String styleSheetText; | 1430 String styleSheetText; |
| 1431 bool success = getText(&styleSheetText); | 1431 bool success = getText(&styleSheetText); |
| 1432 if (success) { | 1432 if (success) { |
| 1433 bool deprecated; | 1433 bool deprecated; |
| 1434 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText,
ContentSearchUtils::CSSMagicComment, &deprecated); | 1434 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText,
ContentSearchUtils::CSSMagicComment, &deprecated); |
| 1435 if (!commentValue.isEmpty()) { | 1435 if (!commentValue.isEmpty()) { |
| 1436 if (deprecated) | 1436 // FIXME: add deprecated console message here. |
| 1437 m_pageAgent->page()->console()->addMessage(NetworkMessageSource,
WarningMessageLevel, "\"/*@ sourceURL=\" source URL declaration is deprecated,
\"/*# sourceURL=\" declaration should be used instead.", finalURL(), 0); | |
| 1438 m_sourceURL = commentValue; | 1437 m_sourceURL = commentValue; |
| 1439 return commentValue; | 1438 return commentValue; |
| 1440 } | 1439 } |
| 1441 } | 1440 } |
| 1442 m_sourceURL = ""; | 1441 m_sourceURL = ""; |
| 1443 return m_sourceURL; | 1442 return m_sourceURL; |
| 1444 } | 1443 } |
| 1445 | 1444 |
| 1446 String InspectorStyleSheet::url() const | 1445 String InspectorStyleSheet::url() const |
| 1447 { | 1446 { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 { | 1479 { |
| 1481 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular) | 1480 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular) |
| 1482 return String(); | 1481 return String(); |
| 1483 | 1482 |
| 1484 String styleSheetText; | 1483 String styleSheetText; |
| 1485 bool success = getText(&styleSheetText); | 1484 bool success = getText(&styleSheetText); |
| 1486 if (success) { | 1485 if (success) { |
| 1487 bool deprecated; | 1486 bool deprecated; |
| 1488 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex
t, ContentSearchUtils::CSSMagicComment, &deprecated); | 1487 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex
t, ContentSearchUtils::CSSMagicComment, &deprecated); |
| 1489 if (!commentValue.isEmpty()) { | 1488 if (!commentValue.isEmpty()) { |
| 1490 if (deprecated) | 1489 // FIXME: add deprecated console message here. |
| 1491 m_pageAgent->page()->console()->addMessage(NetworkMessageSource,
WarningMessageLevel, "\"/*@ sourceMappingURL=\" source mapping URL declaration
is deprecated, \"/*# sourceMappingURL=\" declaration should be used instead.", f
inalURL(), 0); | |
| 1492 return commentValue; | 1490 return commentValue; |
| 1493 } | 1491 } |
| 1494 } | 1492 } |
| 1495 return m_pageAgent->resourceSourceMapURL(finalURL()); | 1493 return m_pageAgent->resourceSourceMapURL(finalURL()); |
| 1496 } | 1494 } |
| 1497 | 1495 |
| 1498 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co
nst | 1496 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co
nst |
| 1499 { | 1497 { |
| 1500 unsigned index = ruleIndexByStyle(style); | 1498 unsigned index = ruleIndexByStyle(style); |
| 1501 if (index != UINT_MAX) | 1499 if (index != UINT_MAX) |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 | 1809 |
| 1812 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); | 1810 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); |
| 1813 RuleSourceDataList ruleSourceDataResult; | 1811 RuleSourceDataList ruleSourceDataResult; |
| 1814 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc
ument()->elementSheet()->contents(), &ruleSourceDataResult); | 1812 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc
ument()->elementSheet()->contents(), &ruleSourceDataResult); |
| 1815 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); | 1813 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); |
| 1816 return ruleSourceDataResult.first().release(); | 1814 return ruleSourceDataResult.first().release(); |
| 1817 } | 1815 } |
| 1818 | 1816 |
| 1819 } // namespace WebCore | 1817 } // namespace WebCore |
| 1820 | 1818 |
| OLD | NEW |