OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 static inline void appendContextSubtargetsForNode(Node* node, SubtargetGeometryL
ist& subtargets) | 156 static inline void appendContextSubtargetsForNode(Node* node, SubtargetGeometryL
ist& subtargets) |
157 { | 157 { |
158 // This is a variant of appendBasicSubtargetsForNode that adds special subta
rgets for | 158 // This is a variant of appendBasicSubtargetsForNode that adds special subta
rgets for |
159 // selected or auto-selectable parts of text nodes. | 159 // selected or auto-selectable parts of text nodes. |
160 ASSERT(node->renderer()); | 160 ASSERT(node->renderer()); |
161 | 161 |
162 if (!node->isTextNode()) | 162 if (!node->isTextNode()) |
163 return appendBasicSubtargetsForNode(node, subtargets); | 163 return appendBasicSubtargetsForNode(node, subtargets); |
164 | 164 |
165 Text* textNode = toText(node); | 165 Text* textNode = toText(node); |
166 RenderText* textRenderer = toRenderText(textNode->renderer()); | 166 RenderText* textRenderer = textNode->renderer(); |
167 | 167 |
168 if (textRenderer->frame()->editor().behavior().shouldSelectOnContextualMenuC
lick()) { | 168 if (textRenderer->frame()->editor().behavior().shouldSelectOnContextualMenuC
lick()) { |
169 // Make subtargets out of every word. | 169 // Make subtargets out of every word. |
170 String textValue = textNode->data(); | 170 String textValue = textNode->data(); |
171 TextBreakIterator* wordIterator = wordBreakIterator(textValue, 0, textVa
lue.length()); | 171 TextBreakIterator* wordIterator = wordBreakIterator(textValue, 0, textVa
lue.length()); |
172 int lastOffset = wordIterator->first(); | 172 int lastOffset = wordIterator->first(); |
173 if (lastOffset == -1) | 173 if (lastOffset == -1) |
174 return; | 174 return; |
175 int offset; | 175 int offset; |
176 while ((offset = wordIterator->next()) != -1) { | 176 while ((offset = wordIterator->next()) != -1) { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 504 |
505 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node> >& nodes) | 505 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node> >& nodes) |
506 { | 506 { |
507 IntPoint targetPoint; | 507 IntPoint targetPoint; |
508 TouchAdjustment::SubtargetGeometryList subtargets; | 508 TouchAdjustment::SubtargetGeometryList subtargets; |
509 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); | 509 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); |
510 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); | 510 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); |
511 } | 511 } |
512 | 512 |
513 } // namespace blink | 513 } // namespace blink |
OLD | NEW |