Changeset 175758 in webkit
- Timestamp:
- Nov 7, 2014, 12:29:49 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r175755 r175758 1 2014-11-07 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Pseudo element matchedCSSRules do not include matching selector info 4 https://bugs.webkit.org/show_bug.cgi?id=138438 5 6 Reviewed by Benjamin Poulain. 7 8 * inspector/css/pseudo-element-matches-expected.txt: Added. 9 * inspector/css/pseudo-element-matches.html: Added. 10 Add a test to ensure we get correct selector matches for a pseudo element 11 inside of an <audio> element. The test is heavily coupled to our UserAgent 12 stylesheet and Shadow DOM layout, so check for possible failures if 13 WebCore changes things. 14 1 15 2014-11-07 Bem Jones-Bey <bjonesbe@adobe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r175752 r175758 1 2014-11-07 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Pseudo element matchedCSSRules do not include matching selector info 4 https://bugs.webkit.org/show_bug.cgi?id=138438 5 6 Reviewed by Benjamin Poulain. 7 8 Test: inspector/css/psuedo-element-matches.html 9 10 Element::matches is not the correct API to use to check selectors with pseudo-elements. 11 Instead we should use the CSS Selector checking machinary which understands them. 12 13 * inspector/InspectorCSSAgent.cpp: 14 (WebCore::InspectorCSSAgent::getSupportedCSSProperties): 15 (WebCore::InspectorCSSAgent::buildArrayForRuleList): 16 (WebCore::InspectorCSSAgent::buildArrayForRegions): 17 (WebCore::InspectorCSSAgent::buildObjectForNamedFlow): 18 Some RefPtr release improvements. 19 20 (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList): 21 Use a SelectorChecker to check each Selector against the element. 22 This matches the SelectorChecker used when we collected the rules 23 for this element. 24 1 25 2014-11-07 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r175719 r175758 50 50 #include "RenderNamedFlowFragment.h" 51 51 #include "SVGStyleElement.h" 52 #include "SelectorChecker.h" 52 53 #include "StyleProperties.h" 53 54 #include "StylePropertyShorthand.h" … … 827 828 longhands->addItem(getPropertyNameString(longhandID)); 828 829 } 829 property->setLonghands(longhands );830 property->setLonghands(longhands.release()); 830 831 properties->addItem(property.release()); 831 832 } … … 1048 1049 if (!ruleObject) 1049 1050 continue; 1050 result->addItem(ruleObject );1051 result->addItem(ruleObject.release()); 1051 1052 } 1052 1053 return result.release(); … … 1056 1057 { 1057 1058 RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> result = Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>::create(); 1059 1060 SelectorChecker::CheckingContext context(SelectorChecker::Mode::CollectingRules); 1061 SelectorChecker selectorChecker(element->document()); 1058 1062 1059 1063 for (unsigned i = 0; i < matchedRules.size(); ++i) { 1060 1064 if (!matchedRules[i]->isStyleRule()) 1061 1065 continue; 1066 1062 1067 StyleRule* matchedStyleRule = static_cast<StyleRule*>(matchedRules[i].get()); 1063 1068 RefPtr<Inspector::Protocol::CSS::CSSRule> ruleObject = buildObjectForRule(matchedStyleRule, styleResolver); 1064 1069 if (!ruleObject) 1065 1070 continue; 1071 1066 1072 RefPtr<Inspector::Protocol::Array<int>> matchingSelectors = Inspector::Protocol::Array<int>::create(); 1067 1073 const CSSSelectorList& selectorList = matchedStyleRule->selectorList(); 1068 1074 long index = 0; 1069 1075 for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) { 1070 bool matched = element->matches(selector->selectorText(), IGNORE_EXCEPTION);1076 bool matched = selectorChecker.match(selector, element, context); 1071 1077 if (matched) 1072 1078 matchingSelectors->addItem(index); 1073 1079 ++index; 1074 1080 } 1081 1075 1082 RefPtr<Inspector::Protocol::CSS::RuleMatch> match = Inspector::Protocol::CSS::RuleMatch::create() 1076 .setRule(ruleObject )1077 .setMatchingSelectors(matchingSelectors );1078 result->addItem(match );1083 .setRule(ruleObject.release()) 1084 .setMatchingSelectors(matchingSelectors.release()); 1085 result->addItem(match.release()); 1079 1086 } 1080 1087 … … 1129 1136 .setNodeId(m_domAgent->pushNodeToFrontend(errorString, documentNodeId, regionList->item(i))); 1130 1137 1131 regions->addItem(region );1138 regions->addItem(region.release()); 1132 1139 } 1133 1140 … … 1145 1152 } 1146 1153 1147 RefPtr<Inspector::Protocol::CSS::NamedFlow> namedFlow =Inspector::Protocol::CSS::NamedFlow::create()1154 return Inspector::Protocol::CSS::NamedFlow::create() 1148 1155 .setDocumentNodeId(documentNodeId) 1149 1156 .setName(webkitNamedFlow->name().string()) 1150 1157 .setOverset(webkitNamedFlow->overset()) 1151 .setContent(content) 1152 .setRegions(buildArrayForRegions(errorString, webkitNamedFlow->getRegions(), documentNodeId)); 1153 1154 return namedFlow.release(); 1158 .setContent(content.release()) 1159 .setRegions(buildArrayForRegions(errorString, webkitNamedFlow->getRegions(), documentNodeId)) 1160 .release(); 1155 1161 } 1156 1162 -
trunk/Source/WebInspectorUI/ChangeLog
r175658 r175758 1 2014-11-07 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Pseudo element matchedCSSRules do not include matching selector info 4 https://bugs.webkit.org/show_bug.cgi?id=138438 5 6 Reviewed by Benjamin Poulain. 7 8 * UserInterface/Base/Test.js: 9 (WebInspector.loaded): 10 Include a global setting for shadow dom used by DOM model classes. 11 Give it a "test" specific name to not override non-test setting values. 12 1 13 2014-11-05 Commit Queue <commit-queue@webkit.org> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Base/Test.js
r175478 r175758 64 64 // Perform one-time tasks. 65 65 WebInspector.CSSCompletions.requestCSSNameCompletions(); 66 67 this.showShadowDOMSetting = new WebInspector.Setting("test-show-shadow-dom", true); 66 68 } 67 69
Note:
See TracChangeset
for help on using the changeset viewer.