Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 18580011: DevTools: Disable sourceUrl and SourceMappingUrl deprecation warnings for a few releases. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 m_sourceURL = ""; 1424 m_sourceURL = "";
1425 return m_sourceURL; 1425 return m_sourceURL;
1426 } 1426 }
1427 1427
1428 String styleSheetText; 1428 String styleSheetText;
1429 bool success = getText(&styleSheetText); 1429 bool success = getText(&styleSheetText);
1430 if (success) { 1430 if (success) {
1431 bool deprecated; 1431 bool deprecated;
1432 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText, ContentSearchUtils::CSSMagicComment, &deprecated); 1432 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText, ContentSearchUtils::CSSMagicComment, &deprecated);
1433 if (!commentValue.isEmpty()) { 1433 if (!commentValue.isEmpty()) {
1434 if (deprecated) 1434 // FIXME: add deprecated console message here.
1435 m_pageAgent->page()->console()->addMessage(NetworkMessageSource, WarningMessageLevel, "\"/*@ sourceURL=\" source URL declaration is deprecated, \"/*# sourceURL=\" declaration should be used instead.", finalURL(), 0);
1436 m_sourceURL = commentValue; 1435 m_sourceURL = commentValue;
1437 return commentValue; 1436 return commentValue;
1438 } 1437 }
1439 } 1438 }
1440 m_sourceURL = ""; 1439 m_sourceURL = "";
1441 return m_sourceURL; 1440 return m_sourceURL;
1442 } 1441 }
1443 1442
1444 String InspectorStyleSheet::url() const 1443 String InspectorStyleSheet::url() const
1445 { 1444 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 { 1477 {
1479 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular) 1478 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular)
1480 return String(); 1479 return String();
1481 1480
1482 String styleSheetText; 1481 String styleSheetText;
1483 bool success = getText(&styleSheetText); 1482 bool success = getText(&styleSheetText);
1484 if (success) { 1483 if (success) {
1485 bool deprecated; 1484 bool deprecated;
1486 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex t, ContentSearchUtils::CSSMagicComment, &deprecated); 1485 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex t, ContentSearchUtils::CSSMagicComment, &deprecated);
1487 if (!commentValue.isEmpty()) { 1486 if (!commentValue.isEmpty()) {
1488 if (deprecated) 1487 // FIXME: add deprecated console message here.
1489 m_pageAgent->page()->console()->addMessage(NetworkMessageSource, WarningMessageLevel, "\"/*@ sourceMappingURL=\" source mapping URL declaration is deprecated, \"/*# sourceMappingURL=\" declaration should be used instead.", f inalURL(), 0);
1490 return commentValue; 1488 return commentValue;
1491 } 1489 }
1492 } 1490 }
1493 return m_pageAgent->resourceSourceMapURL(finalURL()); 1491 return m_pageAgent->resourceSourceMapURL(finalURL());
1494 } 1492 }
1495 1493
1496 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co nst 1494 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co nst
1497 { 1495 {
1498 unsigned index = ruleIndexByStyle(style); 1496 unsigned index = ruleIndexByStyle(style);
1499 if (index != UINT_MAX) 1497 if (index != UINT_MAX)
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 1807
1810 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate(); 1808 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate();
1811 RuleSourceDataList ruleSourceDataResult; 1809 RuleSourceDataList ruleSourceDataResult;
1812 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult); 1810 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult);
1813 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get (), m_styleText, &handler, m_element->document()->elementSheet()->contents()); 1811 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get (), m_styleText, &handler, m_element->document()->elementSheet()->contents());
1814 return ruleSourceDataResult.first().release(); 1812 return ruleSourceDataResult.first().release();
1815 } 1813 }
1816 1814
1817 } // namespace WebCore 1815 } // namespace WebCore
1818 1816
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698