Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 ScrollableArea::setConstrainsScrollingToContentEdge(false); | 87 ScrollableArea::setConstrainsScrollingToContentEdge(false); |
| 88 | 88 |
| 89 Node* node = m_box->node(); | 89 Node* node = m_box->node(); |
| 90 if (node && node->isElementNode()) { | 90 if (node && node->isElementNode()) { |
| 91 // We save and restore only the scrollOffset as the other scroll values are recalculated. | 91 // We save and restore only the scrollOffset as the other scroll values are recalculated. |
| 92 Element* element = toElement(node); | 92 Element* element = toElement(node); |
| 93 m_scrollOffset = element->savedLayerScrollOffset(); | 93 m_scrollOffset = element->savedLayerScrollOffset(); |
| 94 if (!m_scrollOffset.isZero()) | 94 if (!m_scrollOffset.isZero()) |
| 95 scrollAnimator()->setCurrentPosition(FloatPoint(m_scrollOffset.width (), m_scrollOffset.height())); | 95 scrollAnimator()->setCurrentPosition(FloatPoint(m_scrollOffset.width (), m_scrollOffset.height())); |
| 96 element->setSavedLayerScrollOffset(IntSize()); | 96 element->setSavedLayerScrollOffset(IntSize()); |
| 97 element->setMinimumSizeForResizing(LayoutSize(LayoutUnit(m_box->style()- >logicalMinWidth().value()), LayoutUnit(m_box->style()->logicalMinHeight().value ()))); | |
|
Julien - ping for review
2014/04/18 17:04:08
This is wrong for several reasons:
1. it's not dyn
harpreet.sk
2014/04/21 13:21:55
I have added the logic into updateAfterStyleChange
| |
| 97 } | 98 } |
| 98 | 99 |
| 99 updateResizerAreaSet(); | 100 updateResizerAreaSet(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 RenderLayerScrollableArea::~RenderLayerScrollableArea() | 103 RenderLayerScrollableArea::~RenderLayerScrollableArea() |
| 103 { | 104 { |
| 104 if (inResizeMode() && !m_box->documentBeingDestroyed()) { | 105 if (inResizeMode() && !m_box->documentBeingDestroyed()) { |
| 105 if (LocalFrame* frame = m_box->frame()) | 106 if (LocalFrame* frame = m_box->frame()) |
| 106 frame->eventHandler().resizeScrollableAreaDestroyed(); | 107 frame->eventHandler().resizeScrollableAreaDestroyed(); |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1329 ASSERT_NOT_REACHED(); | 1330 ASSERT_NOT_REACHED(); |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 float zoomFactor = m_box->style()->effectiveZoom(); | 1333 float zoomFactor = m_box->style()->effectiveZoom(); |
| 1333 | 1334 |
| 1334 LayoutSize newOffset = offsetFromResizeCorner(document.view()->windowToConte nts(pos)); | 1335 LayoutSize newOffset = offsetFromResizeCorner(document.view()->windowToConte nts(pos)); |
| 1335 newOffset.setWidth(newOffset.width() / zoomFactor); | 1336 newOffset.setWidth(newOffset.width() / zoomFactor); |
| 1336 newOffset.setHeight(newOffset.height() / zoomFactor); | 1337 newOffset.setHeight(newOffset.height() / zoomFactor); |
| 1337 | 1338 |
| 1338 LayoutSize currentSize = LayoutSize(m_box->width() / zoomFactor, m_box->heig ht() / zoomFactor); | 1339 LayoutSize currentSize = LayoutSize(m_box->width() / zoomFactor, m_box->heig ht() / zoomFactor); |
| 1339 LayoutSize minimumSize = element->minimumSizeForResizing().shrunkTo(currentS ize); | 1340 LayoutSize minimumSize = element->minimumSizeForResizing(); |
| 1340 element->setMinimumSizeForResizing(minimumSize); | |
| 1341 | 1341 |
| 1342 LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, ol dOffset.height() / zoomFactor); | 1342 LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, ol dOffset.height() / zoomFactor); |
| 1343 if (m_box->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) { | 1343 if (m_box->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) { |
| 1344 newOffset.setWidth(-newOffset.width()); | 1344 newOffset.setWidth(-newOffset.width()); |
| 1345 adjustedOldOffset.setWidth(-adjustedOldOffset.width()); | 1345 adjustedOldOffset.setWidth(-adjustedOldOffset.width()); |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expand edTo(minimumSize) - currentSize; | 1348 LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expand edTo(minimumSize) - currentSize; |
| 1349 | 1349 |
| 1350 bool isBoxSizingBorder = m_box->style()->boxSizing() == BORDER_BOX; | 1350 bool isBoxSizingBorder = m_box->style()->boxSizing() == BORDER_BOX; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1505 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) | 1505 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) |
| 1506 { | 1506 { |
| 1507 if (m_forceNeedsCompositedScrolling == mode) | 1507 if (m_forceNeedsCompositedScrolling == mode) |
| 1508 return; | 1508 return; |
| 1509 | 1509 |
| 1510 m_forceNeedsCompositedScrolling = mode; | 1510 m_forceNeedsCompositedScrolling = mode; |
| 1511 layer()->didUpdateNeedsCompositedScrolling(); | 1511 layer()->didUpdateNeedsCompositedScrolling(); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 } // Namespace WebCore | 1514 } // Namespace WebCore |
| OLD | NEW |