- Revision
- 199099
- Author
- [email protected]
- Date
- 2016-04-06 05:26:49 -0700 (Wed, 06 Apr 2016)
Log Message
REGRESSION(r196629): Messages text size only changes for sending text, conversation text size does not change
https://bugs.webkit.org/show_bug.cgi?id=156287
<rdar://problem/24264756>
Reviewed by Andreas Kling.
Source/WebCore:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::makeAttributeSelectorKey):
Include attribute value to the key. Otherwise we may deduplicate selectors that are not indentical.
(WebCore::RuleFeatureSet::collectFeatures):
(WebCore::RuleFeatureSet::add):
Use HashMap::ensure().
* css/RuleFeature.h:
LayoutTests:
* fast/css/style-invalidation-attribute-change-descendants-expected.txt:
* fast/css/style-invalidation-attribute-change-descendants.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (199098 => 199099)
--- trunk/LayoutTests/ChangeLog 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/LayoutTests/ChangeLog 2016-04-06 12:26:49 UTC (rev 199099)
@@ -1,3 +1,14 @@
+2016-04-06 Antti Koivisto <[email protected]>
+
+ REGRESSION(r196629): Messages text size only changes for sending text, conversation text size does not change
+ https://bugs.webkit.org/show_bug.cgi?id=156287
+ <rdar://problem/24264756>
+
+ Reviewed by Andreas Kling.
+
+ * fast/css/style-invalidation-attribute-change-descendants-expected.txt:
+ * fast/css/style-invalidation-attribute-change-descendants.html:
+
2016-04-06 Manuel Rego Casasnovas <[email protected]>
[css-grid] Fix positioned children in RTL
Modified: trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants-expected.txt (199098 => 199099)
--- trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants-expected.txt 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants-expected.txt 2016-04-06 12:26:49 UTC (rev 199099)
@@ -154,6 +154,11 @@
PASS testStyleChangeType("target", "InlineStyleChange") is true
PASS testStyleChangeType("inert", "NoStyleChange") is true
PASS hasExpectedStyle is true
+Setting attribute 'myattr' value 'value11'
+PASS testStyleChangeType("root", "NoStyleChange") || testStyleChangeType("root", "InlineStyleChange") is true
+PASS testStyleChangeType("target", "InlineStyleChange") is true
+PASS testStyleChangeType("inert", "NoStyleChange") is true
+PASS hasExpectedStyle is true
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants.html (199098 => 199099)
--- trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants.html 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/LayoutTests/fast/css/style-invalidation-attribute-change-descendants.html 2016-04-06 12:26:49 UTC (rev 199099)
@@ -46,6 +46,10 @@
color: rgb(10, 0, 0);
}
+[myattr=value11] target {
+ color: rgb(11, 0, 0);
+}
+
</style>
</head>
<body>
@@ -251,6 +255,10 @@
testStyleInvalidation("InlineStyleChange");
checkStyle(1);
+setAttribute('myattr', 'value11');
+testStyleInvalidation("InlineStyleChange");
+checkStyle(11);
+
</script>
<script src=""
</html>
Modified: trunk/Source/WebCore/ChangeLog (199098 => 199099)
--- trunk/Source/WebCore/ChangeLog 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/Source/WebCore/ChangeLog 2016-04-06 12:26:49 UTC (rev 199099)
@@ -1,3 +1,24 @@
+2016-04-06 Antti Koivisto <[email protected]>
+
+ REGRESSION(r196629): Messages text size only changes for sending text, conversation text size does not change
+ https://bugs.webkit.org/show_bug.cgi?id=156287
+ <rdar://problem/24264756>
+
+ Reviewed by Andreas Kling.
+
+ * css/RuleFeature.cpp:
+ (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
+ (WebCore::makeAttributeSelectorKey):
+
+ Include attribute value to the key. Otherwise we may deduplicate selectors that are not indentical.
+
+ (WebCore::RuleFeatureSet::collectFeatures):
+ (WebCore::RuleFeatureSet::add):
+
+ Use HashMap::ensure().
+
+ * css/RuleFeature.h:
+
2016-04-06 Manuel Rego Casasnovas <[email protected]>
[css-grid] Fix positioned children in RTL
Modified: trunk/Source/WebCore/css/RuleFeature.cpp (199098 => 199099)
--- trunk/Source/WebCore/css/RuleFeature.cpp 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/Source/WebCore/css/RuleFeature.cpp 2016-04-06 12:26:49 UTC (rev 199099)
@@ -84,11 +84,11 @@
} while (selector);
}
-static std::pair<AtomicStringImpl*, unsigned> makeAttributeSelectorKey(const CSSSelector& selector)
+static RuleFeatureSet::AttributeRules::SelectorKey makeAttributeSelectorKey(const CSSSelector& selector)
{
bool caseInsensitive = selector.attributeValueMatchingIsCaseInsensitive();
unsigned matchAndCase = static_cast<unsigned>(selector.match()) << 1 | caseInsensitive;
- return std::make_pair(selector.attributeCanonicalLocalName().impl(), matchAndCase);
+ return std::make_pair(selector.attributeCanonicalLocalName().impl(), std::make_pair(selector.value().impl(), matchAndCase));
}
void RuleFeatureSet::collectFeatures(const RuleData& ruleData)
@@ -100,16 +100,16 @@
if (ruleData.containsUncommonAttributeSelector())
uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
for (auto* className : selectorFeatures.classesMatchingAncestors) {
- auto addResult = ancestorClassRules.add(className, nullptr);
- if (addResult.isNewEntry)
- addResult.iterator->value = std::make_unique<Vector<RuleFeature>>();
+ auto addResult = ancestorClassRules.ensure(className, [] {
+ return std::make_unique<Vector<RuleFeature>>();
+ });
addResult.iterator->value->append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}
for (auto* selector : selectorFeatures.attributeSelectorsMatchingAncestors) {
// Hashing by attributeCanonicalLocalName makes this HTML specific.
- auto addResult = ancestorAttributeRulesForHTML.add(selector->attributeCanonicalLocalName().impl(), nullptr);
- if (addResult.isNewEntry)
- addResult.iterator->value = std::make_unique<AttributeRules>();
+ auto addResult = ancestorAttributeRulesForHTML.ensure(selector->attributeCanonicalLocalName().impl(), [] {
+ return std::make_unique<AttributeRules>();
+ });
auto& rules = *addResult.iterator->value;
rules.features.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
// Deduplicate selectors.
@@ -127,16 +127,15 @@
siblingRules.appendVector(other.siblingRules);
uncommonAttributeRules.appendVector(other.uncommonAttributeRules);
for (auto& keyValuePair : other.ancestorClassRules) {
- auto addResult = ancestorClassRules.add(keyValuePair.key, nullptr);
- if (addResult.isNewEntry)
- addResult.iterator->value = std::make_unique<Vector<RuleFeature>>(*keyValuePair.value);
- else
- addResult.iterator->value->appendVector(*keyValuePair.value);
+ auto addResult = ancestorClassRules.ensure(keyValuePair.key, [] {
+ return std::make_unique<Vector<RuleFeature>>();
+ });
+ addResult.iterator->value->appendVector(*keyValuePair.value);
}
for (auto& keyValuePair : other.ancestorAttributeRulesForHTML) {
- auto addResult = ancestorAttributeRulesForHTML.add(keyValuePair.key, nullptr);
- if (addResult.isNewEntry)
- addResult.iterator->value = std::make_unique<AttributeRules>();
+ auto addResult = ancestorAttributeRulesForHTML.ensure(keyValuePair.key, [] {
+ return std::make_unique<AttributeRules>();
+ });
auto& rules = *addResult.iterator->value;
rules.features.appendVector(keyValuePair.value->features);
for (auto& selectorPair : keyValuePair.value->selectors)
Modified: trunk/Source/WebCore/css/RuleFeature.h (199098 => 199099)
--- trunk/Source/WebCore/css/RuleFeature.h 2016-04-06 10:21:59 UTC (rev 199098)
+++ trunk/Source/WebCore/css/RuleFeature.h 2016-04-06 12:26:49 UTC (rev 199099)
@@ -61,7 +61,8 @@
HashMap<AtomicStringImpl*, std::unique_ptr<Vector<RuleFeature>>> ancestorClassRules;
struct AttributeRules {
- HashMap<std::pair<AtomicStringImpl*, unsigned>, const CSSSelector*> selectors;
+ using SelectorKey = std::pair<AtomicStringImpl*, std::pair<AtomicStringImpl*, unsigned>>;
+ HashMap<SelectorKey, const CSSSelector*> selectors;
Vector<RuleFeature> features;
};
HashMap<AtomicStringImpl*, std::unique_ptr<AttributeRules>> ancestorAttributeRulesForHTML;