| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 if (!visibleSelection.isCaretOrRange()) | 1578 if (!visibleSelection.isCaretOrRange()) |
| 1579 return false; | 1579 return false; |
| 1580 | 1580 |
| 1581 // Non-editable caret selections lack any kind of UI affordance, and | 1581 // Non-editable caret selections lack any kind of UI affordance, and |
| 1582 // needn't be tracked by the client. | 1582 // needn't be tracked by the client. |
| 1583 if (visibleSelection.isCaret() && !visibleSelection.isContentEditable()) | 1583 if (visibleSelection.isCaret() && !visibleSelection.isContentEditable()) |
| 1584 return false; | 1584 return false; |
| 1585 | 1585 |
| 1586 VisiblePosition visibleStart(visibleSelection.visibleStart()); | 1586 VisiblePosition visibleStart(visibleSelection.visibleStart()); |
| 1587 RenderedPosition renderedStart(visibleStart); | 1587 RenderedPosition renderedStart(visibleStart); |
| 1588 renderedStart.positionInGraphicsLayerBacking(selection.start); | 1588 renderedStart.positionInGraphicsLayerBacking(selection.start, true); |
| 1589 if (!selection.start.layer) | 1589 if (!selection.start.layer) |
| 1590 return false; | 1590 return false; |
| 1591 | 1591 |
| 1592 if (visibleSelection.isCaret()) { | 1592 VisiblePosition visibleEnd(visibleSelection.visibleEnd()); |
| 1593 selection.end = selection.start; | 1593 RenderedPosition renderedEnd(visibleEnd); |
| 1594 } else { | 1594 renderedEnd.positionInGraphicsLayerBacking(selection.end, false); |
| 1595 VisiblePosition visibleEnd(visibleSelection.visibleEnd()); | 1595 if (!selection.end.layer) |
| 1596 RenderedPosition renderedEnd(visibleEnd); | 1596 return false; |
| 1597 renderedEnd.positionInGraphicsLayerBacking(selection.end); | |
| 1598 if (!selection.end.layer) | |
| 1599 return false; | |
| 1600 } | |
| 1601 | 1597 |
| 1602 selection.type = visibleSelection.selectionType(); | 1598 selection.type = visibleSelection.selectionType(); |
| 1603 selection.isEditable = visibleSelection.isContentEditable(); | 1599 selection.isEditable = visibleSelection.isContentEditable(); |
| 1604 if (selection.isEditable) { | 1600 if (selection.isEditable) { |
| 1605 if (HTMLTextFormControlElement* enclosingTextFormControlElement = enclos
ingTextFormControl(visibleSelection.rootEditableElement())) | 1601 if (HTMLTextFormControlElement* enclosingTextFormControlElement = enclos
ingTextFormControl(visibleSelection.rootEditableElement())) |
| 1606 selection.isEmptyTextFormControl = enclosingTextFormControlElement->
value().isEmpty(); | 1602 selection.isEmptyTextFormControl = enclosingTextFormControlElement->
value().isEmpty(); |
| 1607 } | 1603 } |
| 1608 selection.start.isTextDirectionRTL = primaryDirectionOf(*visibleSelection.st
art().anchorNode()) == RTL; | 1604 selection.start.isTextDirectionRTL |= primaryDirectionOf(*visibleSelection.s
tart().anchorNode()) == RTL; |
| 1609 selection.end.isTextDirectionRTL = primaryDirectionOf(*visibleSelection.end(
).anchorNode()) == RTL; | 1605 selection.end.isTextDirectionRTL |= primaryDirectionOf(*visibleSelection.end
().anchorNode()) == RTL; |
| 1610 | 1606 |
| 1611 return true; | 1607 return true; |
| 1612 } | 1608 } |
| 1613 | 1609 |
| 1614 void FrameView::updateCompositedSelectionIfNeeded() | 1610 void FrameView::updateCompositedSelectionIfNeeded() |
| 1615 { | 1611 { |
| 1616 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) | 1612 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) |
| 1617 return; | 1613 return; |
| 1618 | 1614 |
| 1619 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); | 1615 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); |
| (...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4008 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4004 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4009 } | 4005 } |
| 4010 | 4006 |
| 4011 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4007 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4012 { | 4008 { |
| 4013 ASSERT(layoutView()); | 4009 ASSERT(layoutView()); |
| 4014 return *layoutView(); | 4010 return *layoutView(); |
| 4015 } | 4011 } |
| 4016 | 4012 |
| 4017 } // namespace blink | 4013 } // namespace blink |
| OLD | NEW |