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

Side by Side Diff: Source/core/layout/LayoutBlockFlow.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2659 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
2660 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 2660 FloatingObjectSetIterator begin = floatingObjectSet.begin();
2661 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { 2661 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) {
2662 --it; 2662 --it;
2663 FloatingObject* floatingObject = it->get(); 2663 FloatingObject* floatingObject = it->get();
2664 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha sSelfPaintingLayer()) { 2664 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha sSelfPaintingLayer()) {
2665 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject ) - floatingObject->layoutObject()->location().x(); 2665 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject ) - floatingObject->layoutObject()->location().x();
2666 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject ) - floatingObject->layoutObject()->location().y(); 2666 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject ) - floatingObject->layoutObject()->location().y();
2667 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj ect, adjustedLocation + LayoutSize(xOffset, yOffset)); 2667 LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObj ect, adjustedLocation + LayoutSize(xOffset, yOffset));
2668 if (floatingObject->layoutObject()->hitTest(result, locationInContai ner, childPoint)) { 2668 if (floatingObject->layoutObject()->hitTest(result, locationInContai ner, childPoint)) {
2669 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(childPoint)); 2669 // TODO(dtapuska): calculate the layout rect
2670 updateHitTestResult(result, locationInContainer.point() - toLayo utSize(childPoint), result.validityRect());
2670 return true; 2671 return true;
2671 } 2672 }
2672 } 2673 }
2673 } 2674 }
2674 2675
2675 return false; 2676 return false;
2676 } 2677 }
2677 2678
2678 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const 2679 LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
2679 { 2680 {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
3150 FrameView* frameView = document().view(); 3151 FrameView* frameView = document().view();
3151 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3152 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3152 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3153 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3153 if (size().height() < visibleHeight) 3154 if (size().height() < visibleHeight)
3154 top += (visibleHeight - size().height()) / 2; 3155 top += (visibleHeight - size().height()) / 2;
3155 setY(top); 3156 setY(top);
3156 dialog->setCentered(top); 3157 dialog->setCentered(top);
3157 } 3158 }
3158 3159
3159 } // namespace blink 3160 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698