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

Side by Side Diff: Source/WebKit/chromium/src/LinkHighlight.cpp

Issue 14729006: Reland "Clear highlight when the highlighted node gets removed from the document" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 m_geometryNeedsUpdate = false; 328 m_geometryNeedsUpdate = false;
329 329
330 RenderLayer* compositingLayer = computeEnclosingCompositingLayer(); 330 RenderLayer* compositingLayer = computeEnclosingCompositingLayer();
331 if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLaye r)) { 331 if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLaye r)) {
332 // We only need to invalidate the layer if the highlight size has change d, otherwise 332 // We only need to invalidate the layer if the highlight size has change d, otherwise
333 // we can just re-position the layer without needing to repaint. 333 // we can just re-position the layer without needing to repaint.
334 m_contentLayer->layer()->invalidate(); 334 m_contentLayer->layer()->invalidate();
335 335
336 if (m_currentGraphicsLayer) 336 if (m_currentGraphicsLayer)
337 m_currentGraphicsLayer->addRepaintRect(FloatRect(layer()->position() .x, layer()->position().y, layer()->bounds().width, layer()->bounds().height)); 337 m_currentGraphicsLayer->addRepaintRect(FloatRect(layer()->position() .x, layer()->position().y, layer()->bounds().width, layer()->bounds().height));
338 } else {
339 clearGraphicsLayerLinkHighlightPointer();
340 releaseResources();
338 } 341 }
339 } 342 }
340 343
341 void LinkHighlight::clearCurrentGraphicsLayer() 344 void LinkHighlight::clearCurrentGraphicsLayer()
342 { 345 {
343 m_currentGraphicsLayer = 0; 346 m_currentGraphicsLayer = 0;
344 m_geometryNeedsUpdate = true; 347 m_geometryNeedsUpdate = true;
345 } 348 }
346 349
347 void LinkHighlight::invalidate() 350 void LinkHighlight::invalidate()
348 { 351 {
349 // Make sure we update geometry on the next callback from WebViewImpl::layou t(). 352 // Make sure we update geometry on the next callback from WebViewImpl::layou t().
350 m_geometryNeedsUpdate = true; 353 m_geometryNeedsUpdate = true;
351 } 354 }
352 355
353 WebLayer* LinkHighlight::layer() 356 WebLayer* LinkHighlight::layer()
354 { 357 {
355 return clipLayer(); 358 return clipLayer();
356 } 359 }
357 360
358 } // namespace WeKit 361 } // namespace WeKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/LinkHighlight.h ('k') | Source/WebKit/chromium/tests/LinkHighlightTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698