Commit 2db34f63 authored by sergeyv@chromium.org's avatar sergeyv@chromium.org

Devtools [LayoutEditor]: Remove caching of the selector information

BUG=501896

Review URL: https://codereview.chromium.org/1305343003

git-svn-id: svn://svn.chromium.org/blink/trunk@201686 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4dc66f94
......@@ -315,7 +315,6 @@ void LayoutEditor::clearSelection(bool commitChanges)
m_element.clear();
m_isDirty = false;
m_matchedRules.clear();
m_cachedSelectorsInfo.clear();
m_currentRuleIndex = -1;
}
......@@ -385,9 +384,6 @@ String LayoutEditor::currentSelectorInfo()
if (!m_element)
return String();
if (m_cachedSelectorsInfo.contains(m_currentRuleIndex))
return m_cachedSelectorsInfo.get(m_currentRuleIndex);
RefPtr<JSONObject> object = JSONObject::create();
String currentSelectorText = m_currentRuleIndex == -1 ? "inline style" : m_matchedRules[m_currentRuleIndex]->selectorText();
object->setString("selector", currentSelectorText);
......@@ -414,8 +410,7 @@ String LayoutEditor::currentSelectorInfo()
}
object->setArray("nodes", highlights.release());
m_cachedSelectorsInfo.add(m_currentRuleIndex, object->toJSONString());
return m_cachedSelectorsInfo.get(m_currentRuleIndex);
return object->toJSONString();
}
} // namespace blink
......@@ -61,7 +61,6 @@ private:
bool m_isDirty;
WillBeHeapVector<RefPtrWillBeMember<CSSStyleRule>> m_matchedRules;
HashMap<int, String> m_cachedSelectorsInfo;
// -1 means "inline style".
int m_currentRuleIndex;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment