Bug 1171731 - Ignore elements with 0 font size in cluster detection. r=kats
authordominique vincent <domivinc@toitl.com>
Fri, 05 Jun 2015 16:25:16 +0200
changeset 247884 b4f355ca322fb6ca04d795720209dd59addc8a14
parent 247883 b971fbbbe37e14d786e036758a1302eacadce226
child 247885 4bd79939fea127dab2f1fbc64236d2a0dd8592fd
push id13460
push userryanvm@gmail.com
push dateWed, 10 Jun 2015 13:17:34 +0000
treeherderfx-team@846253a39b05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1171731
milestone41.0a1
Bug 1171731 - Ignore elements with 0 font size in cluster detection. r=kats
layout/base/PositionedEventTargeting.cpp
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -412,17 +412,18 @@ IsElementClickableAndReadable(nsIFrame* 
   if ((pc->AppUnitsToGfxUnits(frameSize.height) * cumulativeResolution) < limitReadableSize ||
       (pc->AppUnitsToGfxUnits(frameSize.width) * cumulativeResolution) < limitReadableSize) {
     return false;
   }
   nsRefPtr<nsFontMetrics> fm;
   nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm),
     nsLayoutUtils::FontSizeInflationFor(aFrame));
   if (fm) {
-    if ((pc->AppUnitsToGfxUnits(fm->EmHeight()) * cumulativeResolution) < limitReadableSize) {
+    if ((fm->EmHeight() > 0) && // See bug 1171731
+        (pc->AppUnitsToGfxUnits(fm->EmHeight()) * cumulativeResolution) < limitReadableSize) {
       return false;
     }
   }
 
   return true;
 }
 
 nsIFrame*