Changeset 163018 in webkit
- Timestamp:
- Jan 29, 2014 7:20:56 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r163016 r163018 1 2014-01-29 Radu Stavila <stavila@adobe.com> 2 3 [CSSRegions] Unable to scroll a scrollable container for regions using mouse wheel 4 https://bugs.webkit.org/show_bug.cgi?id=123886 5 6 Added tests for scrolling elements flowed into scrollable regions. 7 8 Reviewed by Antti Koivisto. 9 10 * fast/regions/wheel-scroll-abspos-expected.html: Added. 11 * fast/regions/wheel-scroll-abspos.html: Added. 12 * fast/regions/wheel-scroll-expected.html: Added. 13 * fast/regions/wheel-scroll.html: Added. 14 1 15 2014-01-29 Krzysztof Czech <k.czech@samsung.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r163017 r163018 1 2014-01-29 Radu Stavila <stavila@adobe.com> 2 3 [CSSRegions] Unable to scroll a scrollable container for regions using mouse wheel 4 https://bugs.webkit.org/show_bug.cgi?id=123886 5 6 When an element flowed into a scrollable region is scrolled using the mouse wheel, the event 7 needs to be propagated to the region containing that element, on top of which the cursor 8 is located. 9 10 Reviewed by Antti Koivisto. 11 12 Tests: fast/regions/wheel-scroll-abspos.html 13 fast/regions/wheel-scroll.html 14 15 * page/EventHandler.cpp: 16 (WebCore::scrollNode): 17 (WebCore::EventHandler::defaultWheelEventHandler): 18 * rendering/RenderBox.cpp: 19 (WebCore::RenderBox::scroll): 20 (WebCore::RenderBox::scrollWithWheelEventLocation): 21 * rendering/RenderBox.h: 22 * rendering/RenderFlowThread.cpp: 23 (WebCore::RenderFlowThread::regionFromAbsolutePointAndBox): 24 * rendering/RenderFlowThread.h: 25 1 26 2014-01-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 27 -
trunk/Source/WebCore/page/EventHandler.cpp
r163012 r163018 282 282 } 283 283 284 static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement )284 static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement, const IntPoint& absolutePoint) 285 285 { 286 286 if (!delta) … … 290 290 RenderBox* enclosingBox = node->renderer()->enclosingBox(); 291 291 float absDelta = delta > 0 ? delta : -delta; 292 return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopElement); 292 293 return enclosingBox->scrollWithWheelEventLocation(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, enclosingBox, stopElement, absolutePoint); 293 294 } 294 295 … … 2613 2614 // Break up into two scrolls if we need to. Diagonal movement on 2614 2615 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set). 2615 if (dominantDirection != DominantScrollDirectionVertical && scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopElement ))2616 if (dominantDirection != DominantScrollDirectionVertical && scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopElement, roundedIntPoint(wheelEvent->absoluteLocation()))) 2616 2617 wheelEvent->setDefaultHandled(); 2617 2618 2618 if (dominantDirection != DominantScrollDirectionHorizontal && scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopElement ))2619 if (dominantDirection != DominantScrollDirectionHorizontal && scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopElement, roundedIntPoint(wheelEvent->absoluteLocation()))) 2619 2620 wheelEvent->setDefaultHandled(); 2620 2621 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r162960 r163018 761 761 } 762 762 763 bool RenderBox::scroll (ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)764 { 765 RenderLayer* l= layer();766 if ( l && l->scroll(direction, granularity, multiplier)) {763 bool RenderBox::scrollLayer(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement) 764 { 765 RenderLayer* boxLayer = layer(); 766 if (boxLayer && boxLayer->scroll(direction, granularity, multiplier)) { 767 767 if (stopElement) 768 768 *stopElement = element(); 769 769 770 return true; 770 771 } 772 773 return false; 774 } 775 776 bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement) 777 { 778 if (scrollLayer(direction, granularity, multiplier, stopElement)) 779 return true; 771 780 772 781 if (stopElement && *stopElement && *stopElement == element()) … … 776 785 if (b && !b->isRenderView()) 777 786 return b->scroll(direction, granularity, multiplier, stopElement); 787 788 return false; 789 } 790 791 bool RenderBox::scrollWithWheelEventLocation(ScrollDirection direction, ScrollGranularity granularity, float multiplier, RenderBox* startBox, Element** stopElement, IntPoint absolutePoint) 792 { 793 if (scrollLayer(direction, granularity, multiplier, stopElement)) 794 return true; 795 796 if (stopElement && *stopElement && *stopElement == element()) 797 return true; 798 799 RenderBlock* nextScrollBlock = containingBlock(); 800 if (nextScrollBlock && nextScrollBlock->isRenderNamedFlowThread()) { 801 ASSERT(startBox); 802 nextScrollBlock = toRenderFlowThread(nextScrollBlock)->regionFromAbsolutePointAndBox(absolutePoint, *startBox); 803 } 804 805 if (nextScrollBlock && !nextScrollBlock->isRenderView()) 806 return nextScrollBlock->scrollWithWheelEventLocation(direction, granularity, multiplier, startBox, stopElement, absolutePoint); 807 778 808 return false; 779 809 } -
trunk/Source/WebCore/rendering/RenderBox.h
r162892 r163018 454 454 int scrollbarLogicalHeight() const { return style().isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); } 455 455 virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0); 456 virtual bool scrollWithWheelEventLocation(ScrollDirection, ScrollGranularity, float multiplier, RenderBox* startBox, Element** stopElement, IntPoint absolutePoint); 456 457 virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0); 457 458 bool canBeScrolledAndHasScrollableArea() const; … … 658 659 #endif 659 660 661 bool scrollLayer(ScrollDirection, ScrollGranularity, float multiplier, Element** stopElement); 662 660 663 bool fixedElementLaysOutRelativeToFrame(const FrameView&) const; 661 664 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r162602 r163018 461 461 return region ? clampBox->clampToStartAndEndRegions(region) : 0; 462 462 } 463 463 464 RenderRegion* RenderFlowThread::regionFromAbsolutePointAndBox(const IntPoint& absolutePoint, const RenderBox& flowedBox) 465 { 466 RenderRegion* startRegion = nullptr; 467 RenderRegion* endRegion = nullptr; 468 getRegionRangeForBox(&flowedBox, startRegion, endRegion); 469 470 if (!startRegion) 471 return nullptr; 472 473 for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) { 474 RenderRegion* region = *iter; 475 IntRect regionAbsoluteRect(roundedIntPoint(region->localToAbsolute()), roundedIntSize(region->frameRect().size())); 476 if (regionAbsoluteRect.contains(absolutePoint)) 477 return region; 478 479 if (region == endRegion) 480 break; 481 } 482 483 return nullptr; 484 } 485 464 486 LayoutPoint RenderFlowThread::adjustedPositionRelativeToOffsetParent(const RenderBoxModelObject& boxModelObject, const LayoutPoint& startPoint) 465 487 { -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r162366 r163018 116 116 RenderRegion* regionAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastRegion = false, RegionAutoGenerationPolicy = AllowRegionAutoGeneration); 117 117 118 RenderRegion* regionFromAbsolutePointAndBox(const IntPoint&, const RenderBox& flowedBox); 119 118 120 bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; } 119 121 bool regionsHaveUniformLogicalHeight() const { return m_regionsHaveUniformLogicalHeight; }
Note: See TracChangeset
for help on using the changeset viewer.