Skip to content
Permalink
Browse files
Unreviewed, rolling out r195173.
It relies on r195141 which was rolled out

Reverted changeset:

"Give RuleSet a BumpArena and start using it for
RuleDataVectors."
https://bugs.webkit.org/show_bug.cgi?id=153169
http://trac.webkit.org/changeset/195173

Canonical link: https://commits.webkit.org/171319@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Jan 19, 2016
1 parent 9555ff1 commit 74e1d51f7c4d82bc84d0fe5594ff9ec662ea0529
Showing with 24 additions and 24 deletions.
  1. +13 −0 Source/WebCore/ChangeLog
  2. +2 −7 Source/WebCore/css/RuleSet.cpp
  3. +9 −17 Source/WebCore/css/RuleSet.h
@@ -1,3 +1,16 @@
2016-01-19 Chris Dumez <cdumez@apple.com>

Unreviewed, rolling out r195173.

It relies on r195141 which was rolled out

Reverted changeset:

"Give RuleSet a BumpArena and start using it for
RuleDataVectors."
https://bugs.webkit.org/show_bug.cgi?id=153169
http://trac.webkit.org/changeset/195173

2016-01-19 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r195300.
@@ -183,18 +183,13 @@ static void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData
features.uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}

RuleSet::RuleSet()
: m_arena(WTF::BumpArena::create())
{
}

void RuleSet::addToRuleSet(AtomicStringImpl* key, AtomRuleMap& map, const RuleData& ruleData)
{
if (!key)
return;
auto& rules = map.add(key, nullptr).iterator->value;
if (!rules)
rules = RuleDataVector::create(m_arena.get());
rules = std::make_unique<RuleDataVector>();
rules->append(ruleData);
}

@@ -404,7 +399,7 @@ bool RuleSet::hasShadowPseudoElementRules() const
void RuleSet::copyShadowPseudoElementRulesFrom(const RuleSet& other)
{
for (auto& keyValuePair : other.m_shadowPseudoElementRules)
m_shadowPseudoElementRules.add(keyValuePair.key, RuleDataVector::create(m_arena.get(), *keyValuePair.value));
m_shadowPseudoElementRules.add(keyValuePair.key, std::make_unique<RuleDataVector>(*keyValuePair.value));

#if ENABLE(VIDEO_TRACK)
// FIXME: We probably shouldn't treat WebVTT as author stylable user agent shadow tree.
@@ -25,7 +25,6 @@
#include "RuleFeature.h"
#include "SelectorCompiler.h"
#include "StyleRule.h"
#include <wtf/BumpArena.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
@@ -159,19 +158,7 @@ class RuleSet {

RuleSet();

class RuleDataVector : public Vector<RuleData, 1> {
WTF_MAKE_BUMPARENA_ALLOCATED;
public:
static std::unique_ptr<RuleDataVector> create(BumpArena& arena)
{
return std::unique_ptr<RuleDataVector>(new (&arena) RuleDataVector);
}
static std::unique_ptr<RuleDataVector> create(BumpArena& arena, const RuleDataVector& other)
{
return std::unique_ptr<RuleDataVector>(new (&arena) RuleDataVector(other));
}
};

typedef Vector<RuleData, 1> RuleDataVector;
typedef HashMap<AtomicStringImpl*, std::unique_ptr<RuleDataVector>> AtomRuleMap;

void addRulesFromSheet(StyleSheetContents&, const MediaQueryEvaluator&, StyleResolver* = 0);
@@ -226,13 +213,18 @@ class RuleSet {
RuleDataVector m_focusPseudoClassRules;
RuleDataVector m_universalRules;
Vector<StyleRulePage*> m_pageRules;
unsigned m_ruleCount { 0 };
bool m_autoShrinkToFitEnabled { true };
unsigned m_ruleCount;
bool m_autoShrinkToFitEnabled;
RuleFeatureSet m_features;
Vector<RuleSetSelectorPair> m_regionSelectorsAndRuleSets;
Ref<BumpArena> m_arena;
};

inline RuleSet::RuleSet()
: m_ruleCount(0)
, m_autoShrinkToFitEnabled(true)
{
}

inline const RuleSet::RuleDataVector* RuleSet::tagRules(AtomicStringImpl* key, bool isHTMLName) const
{
const AtomRuleMap* tagRules;

0 comments on commit 74e1d51

Please sign in to comment.