| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset
) | 295 static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset
) |
| 296 { | 296 { |
| 297 if (!object) | 297 if (!object) |
| 298 return 0; | 298 return 0; |
| 299 | 299 |
| 300 RenderObject* child = object->childAt(offset); | 300 RenderObject* child = object->childAt(offset); |
| 301 return child ? child : object->nextInPreOrderAfterChildren(); | 301 return child ? child : object->nextInPreOrderAfterChildren(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const | 304 IntRect RenderView::selectionBounds() const |
| 305 { | 305 { |
| 306 typedef HashMap<RawPtr<RenderObject>, OwnPtr<RenderSelectionInfo> > Selectio
nMap; | 306 typedef HashMap<RawPtr<RenderObject>, OwnPtr<RenderSelectionInfo> > Selectio
nMap; |
| 307 SelectionMap selectedObjects; | 307 SelectionMap selectedObjects; |
| 308 | 308 |
| 309 RenderObject* os = m_selectionStart; | 309 RenderObject* os = m_selectionStart; |
| 310 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos
); | 310 RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos
); |
| 311 while (os && os != stop) { | 311 while (os && os != stop) { |
| 312 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec
tionEnd) && os->selectionState() != SelectionNone) { | 312 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selec
tionEnd) && os->selectionState() != SelectionNone) { |
| 313 // Blocks are responsible for painting line gaps and margin gaps. Th
ey must be examined as well. | 313 // Blocks are responsible for painting line gaps and margin gaps. Th
ey must be examined as well. |
| 314 selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToV
isibleContent))); | 314 selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, false))
); |
| 315 RenderBlock* cb = os->containingBlock(); | 315 RenderBlock* cb = os->containingBlock(); |
| 316 while (cb && !cb->isRenderView()) { | 316 while (cb && !cb->isRenderView()) { |
| 317 OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb,
nullptr).storedValue->value; | 317 OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb,
nullptr).storedValue->value; |
| 318 if (blockInfo) | 318 if (blockInfo) |
| 319 break; | 319 break; |
| 320 blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleCo
ntent)); | 320 blockInfo = adoptPtr(new RenderSelectionInfo(cb, false)); |
| 321 cb = cb->containingBlock(); | 321 cb = cb->containingBlock(); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 os = os->nextInPreOrder(); | 325 os = os->nextInPreOrder(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 // Now create a single bounding box rect that encloses the whole selection. | 328 // Now create a single bounding box rect that encloses the whole selection. |
| 329 LayoutRect selRect; | 329 LayoutRect selRect; |
| 330 SelectionMap::iterator end = selectedObjects.end(); | 330 SelectionMap::iterator end = selectedObjects.end(); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 m_iframes.remove(iframe); | 656 m_iframes.remove(iframe); |
| 657 } | 657 } |
| 658 | 658 |
| 659 void RenderView::updateIFramesAfterLayout() | 659 void RenderView::updateIFramesAfterLayout() |
| 660 { | 660 { |
| 661 for (auto& iframe: m_iframes) | 661 for (auto& iframe: m_iframes) |
| 662 iframe->updateWidgetBounds(); | 662 iframe->updateWidgetBounds(); |
| 663 } | 663 } |
| 664 | 664 |
| 665 } // namespace blink | 665 } // namespace blink |
| OLD | NEW |