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

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

Issue 16745003: DevTools: Move CSS.CSSMedia construction into InspectorCSSAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make InspectorPageAgent getter a const one Created 7 years, 6 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
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 TextPosition end = ContentSearchUtils::textPositionFromOffset(range.end, *li neEndings); 446 TextPosition end = ContentSearchUtils::textPositionFromOffset(range.end, *li neEndings);
447 447
448 RefPtr<TypeBuilder::CSS::SourceRange> result = TypeBuilder::CSS::SourceRange ::create() 448 RefPtr<TypeBuilder::CSS::SourceRange> result = TypeBuilder::CSS::SourceRange ::create()
449 .setStartLine(start.m_line.zeroBasedInt()) 449 .setStartLine(start.m_line.zeroBasedInt())
450 .setStartColumn(start.m_column.zeroBasedInt()) 450 .setStartColumn(start.m_column.zeroBasedInt())
451 .setEndLine(end.m_line.zeroBasedInt()) 451 .setEndLine(end.m_line.zeroBasedInt())
452 .setEndColumn(end.m_column.zeroBasedInt()); 452 .setEndColumn(end.m_column.zeroBasedInt());
453 return result.release(); 453 return result.release();
454 } 454 }
455 455
456 static PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList* media, MediaListSource mediaListSource, const String& sourceURL)
457 {
458 // Make certain compilers happy by initializing |source| up-front.
459 TypeBuilder::CSS::CSSMedia::Source::Enum source = TypeBuilder::CSS::CSSMedia ::Source::InlineSheet;
460 switch (mediaListSource) {
461 case MediaListSourceMediaRule:
462 source = TypeBuilder::CSS::CSSMedia::Source::MediaRule;
463 break;
464 case MediaListSourceImportRule:
465 source = TypeBuilder::CSS::CSSMedia::Source::ImportRule;
466 break;
467 case MediaListSourceLinkedSheet:
468 source = TypeBuilder::CSS::CSSMedia::Source::LinkedSheet;
469 break;
470 case MediaListSourceInlineSheet:
471 source = TypeBuilder::CSS::CSSMedia::Source::InlineSheet;
472 break;
473 }
474
475 RefPtr<TypeBuilder::CSS::CSSMedia> mediaObject = TypeBuilder::CSS::CSSMedia: :create()
476 .setText(media->mediaText())
477 .setSource(source);
478
479 if (!sourceURL.isEmpty()) {
480 mediaObject->setSourceURL(sourceURL);
481 mediaObject->setSourceLine(media->queries()->lastLine());
482 }
483 return mediaObject.release();
484 }
485
486 static PassRefPtr<CSSRuleList> asCSSRuleList(CSSStyleSheet* styleSheet) 456 static PassRefPtr<CSSRuleList> asCSSRuleList(CSSStyleSheet* styleSheet)
487 { 457 {
488 if (!styleSheet) 458 if (!styleSheet)
489 return 0; 459 return 0;
490 460
491 RefPtr<StaticCSSRuleList> list = StaticCSSRuleList::create(); 461 RefPtr<StaticCSSRuleList> list = StaticCSSRuleList::create();
492 Vector<RefPtr<CSSRule> >& listRules = list->rules(); 462 Vector<RefPtr<CSSRule> >& listRules = list->rules();
493 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) { 463 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
494 CSSRule* item = styleSheet->item(i); 464 CSSRule* item = styleSheet->item(i);
495 if (item->type() == CSSRule::CHARSET_RULE) 465 if (item->type() == CSSRule::CHARSET_RULE)
(...skipping 16 matching lines...) Expand all
512 482
513 if (rule->type() == CSSRule::HOST_RULE) 483 if (rule->type() == CSSRule::HOST_RULE)
514 return static_cast<CSSHostRule*>(rule)->cssRules(); 484 return static_cast<CSSHostRule*>(rule)->cssRules();
515 485
516 if (rule->type() == CSSRule::SUPPORTS_RULE) 486 if (rule->type() == CSSRule::SUPPORTS_RULE)
517 return static_cast<CSSSupportsRule*>(rule)->cssRules(); 487 return static_cast<CSSSupportsRule*>(rule)->cssRules();
518 488
519 return 0; 489 return 0;
520 } 490 }
521 491
522 static void fillMediaListChain(CSSRule* rule, Array<TypeBuilder::CSS::CSSMedia>* mediaArray)
523 {
524 MediaList* mediaList;
525 CSSRule* parentRule = rule;
526 String sourceURL;
527 while (parentRule) {
528 CSSStyleSheet* parentStyleSheet = 0;
529 bool isMediaRule = true;
530 if (parentRule->type() == CSSRule::MEDIA_RULE) {
531 CSSMediaRule* mediaRule = static_cast<CSSMediaRule*>(parentRule);
532 mediaList = mediaRule->media();
533 parentStyleSheet = mediaRule->parentStyleSheet();
534 } else if (parentRule->type() == CSSRule::IMPORT_RULE) {
535 CSSImportRule* importRule = static_cast<CSSImportRule*>(parentRule);
536 mediaList = importRule->media();
537 parentStyleSheet = importRule->parentStyleSheet();
538 isMediaRule = false;
539 } else
540 mediaList = 0;
541
542 if (parentStyleSheet) {
543 sourceURL = parentStyleSheet->contents()->baseURL();
544 if (sourceURL.isEmpty())
545 sourceURL = InspectorDOMAgent::documentURLString(parentStyleShee t->ownerDocument());
546 } else
547 sourceURL = "";
548
549 if (mediaList && mediaList->length())
550 mediaArray->addItem(buildMediaObject(mediaList, isMediaRule ? MediaL istSourceMediaRule : MediaListSourceImportRule, sourceURL));
551
552 if (parentRule->parentRule())
553 parentRule = parentRule->parentRule();
554 else {
555 CSSStyleSheet* styleSheet = parentRule->parentStyleSheet();
556 while (styleSheet) {
557 mediaList = styleSheet->media();
558 if (mediaList && mediaList->length()) {
559 Document* doc = styleSheet->ownerDocument();
560 if (doc)
561 sourceURL = doc->url();
562 else if (!styleSheet->contents()->baseURL().isEmpty())
563 sourceURL = styleSheet->contents()->baseURL();
564 else
565 sourceURL = "";
566 mediaArray->addItem(buildMediaObject(mediaList, styleSheet-> ownerNode() ? MediaListSourceLinkedSheet : MediaListSourceInlineSheet, sourceURL ));
567 }
568 parentRule = styleSheet->ownerRule();
569 if (parentRule)
570 break;
571 styleSheet = styleSheet->parentStyleSheet();
572 }
573 }
574 }
575 }
576
577 PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheet* parentStyleSheet) 492 PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheet* parentStyleSheet)
578 { 493 {
579 return adoptRef(new InspectorStyle(styleId, style, parentStyleSheet)); 494 return adoptRef(new InspectorStyle(styleId, style, parentStyleSheet));
580 } 495 }
581 496
582 InspectorStyle::InspectorStyle(const InspectorCSSId& styleId, PassRefPtr<CSSStyl eDeclaration> style, InspectorStyleSheet* parentStyleSheet) 497 InspectorStyle::InspectorStyle(const InspectorCSSId& styleId, PassRefPtr<CSSStyl eDeclaration> style, InspectorStyleSheet* parentStyleSheet)
583 : m_styleId(styleId) 498 : m_styleId(styleId)
584 , m_style(style) 499 , m_style(style)
585 , m_parentStyleSheet(parentStyleSheet) 500 , m_parentStyleSheet(parentStyleSheet)
586 , m_formatAcquired(false) 501 , m_formatAcquired(false)
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 m_format.first = formatLineFeed.toString(); 933 m_format.first = formatLineFeed.toString();
1019 m_format.second = isFullPrefixScanned ? prefix.toString() : candidatePrefix; 934 m_format.second = isFullPrefixScanned ? prefix.toString() : candidatePrefix;
1020 return m_format; 935 return m_format;
1021 } 936 }
1022 937
1023 Document* InspectorStyle::ownerDocument() const 938 Document* InspectorStyle::ownerDocument() const
1024 { 939 {
1025 return m_parentStyleSheet->pageStyleSheet() ? m_parentStyleSheet->pageStyleS heet()->ownerDocument() : 0; 940 return m_parentStyleSheet->pageStyleSheet() ? m_parentStyleSheet->pageStyleS heet()->ownerDocument() : 0;
1026 } 941 }
1027 942
1028 PassRefPtr<InspectorStyleSheet> InspectorStyleSheet::create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuild er::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* lis tener) 943 PassRefPtr<InspectorStyleSheet> InspectorStyleSheet::create(InspectorCSSAgent* c ssAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder ::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* liste ner)
1029 { 944 {
1030 return adoptRef(new InspectorStyleSheet(pageAgent, id, pageStyleSheet, origi n, documentURL, listener)); 945 return adoptRef(new InspectorStyleSheet(cssAgent, id, pageStyleSheet, origin , documentURL, listener));
1031 } 946 }
1032 947
1033 // static 948 // static
1034 String InspectorStyleSheet::styleSheetURL(CSSStyleSheet* pageStyleSheet) 949 String InspectorStyleSheet::styleSheetURL(CSSStyleSheet* pageStyleSheet)
1035 { 950 {
1036 if (pageStyleSheet && !pageStyleSheet->contents()->baseURL().isEmpty()) 951 if (pageStyleSheet && !pageStyleSheet->contents()->baseURL().isEmpty())
1037 return pageStyleSheet->contents()->baseURL().string(); 952 return pageStyleSheet->contents()->baseURL().string();
1038 return emptyString(); 953 return emptyString();
1039 } 954 }
1040 955
1041 InspectorStyleSheet::InspectorStyleSheet(InspectorPageAgent* pageAgent, const St ring& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheet Origin::Enum origin, const String& documentURL, Listener* listener) 956 InspectorStyleSheet::InspectorStyleSheet(InspectorCSSAgent* cssAgent, const Stri ng& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOr igin::Enum origin, const String& documentURL, Listener* listener)
1042 : m_pageAgent(pageAgent) 957 : m_cssAgent(cssAgent)
1043 , m_id(id) 958 , m_id(id)
1044 , m_pageStyleSheet(pageStyleSheet) 959 , m_pageStyleSheet(pageStyleSheet)
1045 , m_origin(origin) 960 , m_origin(origin)
1046 , m_documentURL(documentURL) 961 , m_documentURL(documentURL)
1047 , m_isRevalidating(false) 962 , m_isRevalidating(false)
1048 , m_isReparsing(false) 963 , m_isReparsing(false)
1049 , m_listener(listener) 964 , m_listener(listener)
1050 { 965 {
1051 m_parsedStyleSheet = new ParsedStyleSheet(); 966 m_parsedStyleSheet = new ParsedStyleSheet();
1052 } 967 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 1174
1260 Document* document = styleSheet->ownerDocument(); 1175 Document* document = styleSheet->ownerDocument();
1261 Frame* frame = document ? document->frame() : 0; 1176 Frame* frame = document ? document->frame() : 0;
1262 1177
1263 RefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> result = TypeBuilder::CSS::CSS StyleSheetHeader::create() 1178 RefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> result = TypeBuilder::CSS::CSS StyleSheetHeader::create()
1264 .setStyleSheetId(id()) 1179 .setStyleSheetId(id())
1265 .setOrigin(m_origin) 1180 .setOrigin(m_origin)
1266 .setDisabled(styleSheet->disabled()) 1181 .setDisabled(styleSheet->disabled())
1267 .setSourceURL(url()) 1182 .setSourceURL(url())
1268 .setTitle(styleSheet->title()) 1183 .setTitle(styleSheet->title())
1269 .setFrameId(m_pageAgent->frameId(frame)) 1184 .setFrameId(m_cssAgent->pageAgent()->frameId(frame))
1270 .setIsInline(styleSheet->isInline() && !startsAtZero()) 1185 .setIsInline(styleSheet->isInline() && !startsAtZero())
1271 .setStartLine(styleSheet->startPositionInSource().m_line.zeroBasedInt()) 1186 .setStartLine(styleSheet->startPositionInSource().m_line.zeroBasedInt())
1272 .setStartColumn(styleSheet->startPositionInSource().m_column.zeroBasedIn t()); 1187 .setStartColumn(styleSheet->startPositionInSource().m_column.zeroBasedIn t());
1273 1188
1274 if (hasSourceURL()) 1189 if (hasSourceURL())
1275 result->setHasSourceURL(true); 1190 result->setHasSourceURL(true);
1276 1191
1277 String sourceMapURLValue = sourceMapURL(); 1192 String sourceMapURLValue = sourceMapURL();
1278 if (!sourceMapURLValue.isEmpty()) 1193 if (!sourceMapURLValue.isEmpty())
1279 result->setSourceMapURL(sourceMapURLValue); 1194 result->setSourceMapURL(sourceMapURLValue);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 result->setSourceURL(url); 1258 result->setSourceURL(url);
1344 1259
1345 if (canBind()) { 1260 if (canBind()) {
1346 InspectorCSSId id(ruleId(rule)); 1261 InspectorCSSId id(ruleId(rule));
1347 if (!id.isEmpty()) 1262 if (!id.isEmpty())
1348 result->setRuleId(id.asProtocolValue<TypeBuilder::CSS::CSSRuleId>()) ; 1263 result->setRuleId(id.asProtocolValue<TypeBuilder::CSS::CSSRuleId>()) ;
1349 } 1264 }
1350 1265
1351 RefPtr<Array<TypeBuilder::CSS::CSSMedia> > mediaArray = Array<TypeBuilder::C SS::CSSMedia>::create(); 1266 RefPtr<Array<TypeBuilder::CSS::CSSMedia> > mediaArray = Array<TypeBuilder::C SS::CSSMedia>::create();
1352 1267
1353 fillMediaListChain(rule, mediaArray.get()); 1268 m_cssAgent->fillMediaListChain(rule, mediaArray.get());
1354 if (mediaArray->length()) 1269 if (mediaArray->length())
1355 result->setMedia(mediaArray.release()); 1270 result->setMedia(mediaArray.release());
1356 1271
1357 return result.release(); 1272 return result.release();
1358 } 1273 }
1359 1274
1360 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyleSheet::buildObjectForStyle( CSSStyleDeclaration* style) 1275 PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyleSheet::buildObjectForStyle( CSSStyleDeclaration* style)
1361 { 1276 {
1362 RefPtr<CSSRuleSourceData> sourceData; 1277 RefPtr<CSSRuleSourceData> sourceData;
1363 if (ensureParsedDataReady()) 1278 if (ensureParsedDataReady())
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 return m_sourceURL; 1392 return m_sourceURL;
1478 } 1393 }
1479 1394
1480 String styleSheetText; 1395 String styleSheetText;
1481 bool success = getText(&styleSheetText); 1396 bool success = getText(&styleSheetText);
1482 if (success) { 1397 if (success) {
1483 bool deprecated; 1398 bool deprecated;
1484 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText, ContentSearchUtils::CSSMagicComment, &deprecated); 1399 String commentValue = ContentSearchUtils::findSourceURL(styleSheetText, ContentSearchUtils::CSSMagicComment, &deprecated);
1485 if (!commentValue.isEmpty()) { 1400 if (!commentValue.isEmpty()) {
1486 if (deprecated) 1401 if (deprecated)
1487 m_pageAgent->page()->console()->addMessage(NetworkMessageSource, WarningMessageLevel, "\"/*@ sourceURL=\" source URL declaration is deprecated, \"/*# sourceURL=\" declaration should be used instead.", finalURL(), 0); 1402 m_cssAgent->pageAgent()->page()->console()->addMessage(NetworkMe ssageSource, WarningMessageLevel, "\"/*@ sourceURL=\" source URL declaration is deprecated, \"/*# sourceURL=\" declaration should be used instead.", finalURL(), 0);
1488 m_sourceURL = commentValue; 1403 m_sourceURL = commentValue;
1489 return commentValue; 1404 return commentValue;
1490 } 1405 }
1491 } 1406 }
1492 m_sourceURL = ""; 1407 m_sourceURL = "";
1493 return m_sourceURL; 1408 return m_sourceURL;
1494 } 1409 }
1495 1410
1496 String InspectorStyleSheet::url() const 1411 String InspectorStyleSheet::url() const
1497 { 1412 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular) 1446 if (m_origin != TypeBuilder::CSS::StyleSheetOrigin::Regular)
1532 return String(); 1447 return String();
1533 1448
1534 String styleSheetText; 1449 String styleSheetText;
1535 bool success = getText(&styleSheetText); 1450 bool success = getText(&styleSheetText);
1536 if (success) { 1451 if (success) {
1537 bool deprecated; 1452 bool deprecated;
1538 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex t, ContentSearchUtils::CSSMagicComment, &deprecated); 1453 String commentValue = ContentSearchUtils::findSourceMapURL(styleSheetTex t, ContentSearchUtils::CSSMagicComment, &deprecated);
1539 if (!commentValue.isEmpty()) { 1454 if (!commentValue.isEmpty()) {
1540 if (deprecated) 1455 if (deprecated)
1541 m_pageAgent->page()->console()->addMessage(NetworkMessageSource, WarningMessageLevel, "\"/*@ sourceMappingURL=\" source mapping URL declaration is deprecated, \"/*# sourceMappingURL=\" declaration should be used instead.", f inalURL(), 0); 1456 m_cssAgent->pageAgent()->page()->console()->addMessage(NetworkMe ssageSource, WarningMessageLevel, "\"/*@ sourceMappingURL=\" source mapping URL declaration is deprecated, \"/*# sourceMappingURL=\" declaration should be used instead.", finalURL(), 0);
1542 return commentValue; 1457 return commentValue;
1543 } 1458 }
1544 } 1459 }
1545 return m_pageAgent->resourceSourceMapURL(finalURL()); 1460 return m_cssAgent->pageAgent()->resourceSourceMapURL(finalURL());
1546 } 1461 }
1547 1462
1548 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co nst 1463 InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) co nst
1549 { 1464 {
1550 unsigned index = ruleIndexByStyle(style); 1465 unsigned index = ruleIndexByStyle(style);
1551 if (index != UINT_MAX) 1466 if (index != UINT_MAX)
1552 return InspectorCSSId(id(), index); 1467 return InspectorCSSId(id(), index);
1553 return InspectorCSSId(); 1468 return InspectorCSSId();
1554 } 1469 }
1555 1470
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 if (styleRule) 1684 if (styleRule)
1770 result->append(styleRule); 1685 result->append(styleRule);
1771 else { 1686 else {
1772 RefPtr<CSSRuleList> childRuleList = asCSSRuleList(rule); 1687 RefPtr<CSSRuleList> childRuleList = asCSSRuleList(rule);
1773 if (childRuleList) 1688 if (childRuleList)
1774 collectFlatRules(childRuleList, result); 1689 collectFlatRules(childRuleList, result);
1775 } 1690 }
1776 } 1691 }
1777 } 1692 }
1778 1693
1779 PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle: :create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<Element> ele ment, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener) 1694 PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle: :create(InspectorCSSAgent* cssAgent, const String& id, PassRefPtr<Element> eleme nt, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
1780 { 1695 {
1781 return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, id, element , origin, listener)); 1696 return adoptRef(new InspectorStyleSheetForInlineStyle(cssAgent, id, element, origin, listener));
1782 } 1697 }
1783 1698
1784 InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPa geAgent* pageAgent, const String& id, PassRefPtr<Element> element, TypeBuilder:: CSS::StyleSheetOrigin::Enum origin, Listener* listener) 1699 InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorCS SAgent* cssAgent, const String& id, PassRefPtr<Element> element, TypeBuilder::CS S::StyleSheetOrigin::Enum origin, Listener* listener)
1785 : InspectorStyleSheet(pageAgent, id, 0, origin, "", listener) 1700 : InspectorStyleSheet(cssAgent, id, 0, origin, "", listener)
1786 , m_element(element) 1701 , m_element(element)
1787 , m_ruleSourceData(0) 1702 , m_ruleSourceData(0)
1788 , m_isStyleTextValid(false) 1703 , m_isStyleTextValid(false)
1789 { 1704 {
1790 ASSERT(m_element); 1705 ASSERT(m_element);
1791 m_inspectorStyle = InspectorStyle::create(InspectorCSSId(id, 0), inlineStyle (), this); 1706 m_inspectorStyle = InspectorStyle::create(InspectorCSSId(id, 0), inlineStyle (), this);
1792 m_styleText = m_element->isStyledElement() ? m_element->getAttribute("style" ).string() : String(); 1707 m_styleText = m_element->isStyledElement() ? m_element->getAttribute("style" ).string() : String();
1793 } 1708 }
1794 1709
1795 void InspectorStyleSheetForInlineStyle::didModifyElementAttribute() 1710 void InspectorStyleSheetForInlineStyle::didModifyElementAttribute()
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 1805
1891 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate(); 1806 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate();
1892 RuleSourceDataList ruleSourceDataResult; 1807 RuleSourceDataList ruleSourceDataResult;
1893 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult); 1808 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc ument()->elementSheet()->contents(), &ruleSourceDataResult);
1894 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get (), m_styleText, &handler, m_element->document()->elementSheet()->contents()); 1809 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get (), m_styleText, &handler, m_element->document()->elementSheet()->contents());
1895 return ruleSourceDataResult.first().release(); 1810 return ruleSourceDataResult.first().release();
1896 } 1811 }
1897 1812
1898 } // namespace WebCore 1813 } // namespace WebCore
1899 1814
OLDNEW
« Source/core/inspector/InspectorCSSAgent.cpp ('K') | « Source/core/inspector/InspectorStyleSheet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698