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

Unified Diff: Source/WebCore/inspector/InspectorPageAgent.cpp

Issue 11413088: Merge 134577 - Web Inspector: highlight is not updating as one edits CSS properties (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/InspectorPageAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/InspectorPageAgent.cpp
===================================================================
--- Source/WebCore/inspector/InspectorPageAgent.cpp (revision 135283)
+++ Source/WebCore/inspector/InspectorPageAgent.cpp (working copy)
@@ -330,7 +330,8 @@
, m_frontend(0)
, m_overlay(overlay)
, m_lastScriptIdentifier(0)
- , m_didLoadEventFire(false)
+ , m_enabled(false)
+ , m_isFirstLayoutAfterOnLoad(false)
, m_geolocationOverridden(false)
{
}
@@ -371,12 +372,14 @@
void InspectorPageAgent::enable(ErrorString*)
{
+ m_enabled = true;
m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
m_instrumentingAgents->setInspectorPageAgent(this);
}
void InspectorPageAgent::disable(ErrorString*)
{
+ m_enabled = false;
m_state->setBoolean(PageAgentState::pageAgentEnabled, false);
m_instrumentingAgents->setInspectorPageAgent(0);
@@ -776,7 +779,7 @@
void InspectorPageAgent::domContentEventFired()
{
- m_didLoadEventFire = true;
+ m_isFirstLayoutAfterOnLoad = true;
m_frontend->domContentEventFired(currentTime());
}
@@ -882,7 +885,7 @@
void InspectorPageAgent::didPaint(GraphicsContext* context, const LayoutRect& rect)
{
- if (!m_state->getBoolean(PageAgentState::showPaintRects))
+ if (!m_enabled || !m_state->getBoolean(PageAgentState::showPaintRects))
return;
static int colorSelector = 0;
@@ -899,23 +902,35 @@
void InspectorPageAgent::didLayout()
{
- if (!m_didLoadEventFire)
+ bool isFirstLayout = m_isFirstLayoutAfterOnLoad;
+ if (isFirstLayout)
+ m_isFirstLayoutAfterOnLoad = false;
+
+ if (!m_enabled)
return;
- m_didLoadEventFire = false;
- int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenWidthOverride));
- int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenHeightOverride));
+ if (isFirstLayout) {
+ int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenWidthOverride));
+ int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenHeightOverride));
- if (currentWidth && currentHeight)
- m_client->autoZoomPageToFitWidth();
+ if (currentWidth && currentHeight)
+ m_client->autoZoomPageToFitWidth();
+ }
m_overlay->update();
}
void InspectorPageAgent::didScroll()
{
- m_overlay->update();
+ if (m_enabled)
+ m_overlay->update();
}
+void InspectorPageAgent::didRecalculateStyle()
+{
+ if (m_enabled)
+ m_overlay->update();
+}
+
PassRefPtr<TypeBuilder::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
{
RefPtr<TypeBuilder::Page::Frame> frameObject = TypeBuilder::Page::Frame::create()
« no previous file with comments | « Source/WebCore/inspector/InspectorPageAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698