Changeset 22037 in webkit
- Timestamp:
- Jun 6, 2007, 8:11:34 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r22035 r22037 1 2007-06-06 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Harrison. 4 5 <rdar://problem/4889598> Problems with moveDown: and moveUp: in Notes with ToDos 6 7 * editing/selection/4889598-expected.checksum: Added. 8 * editing/selection/4889598-expected.png: Added. 9 * editing/selection/4889598-expected.txt: Added. 10 * editing/selection/4889598.html: Added. 11 1 12 2007-06-06 Sam Weinig <sam@webkit.org> 2 13 -
trunk/WebCore/ChangeLog
r22036 r22037 1 2007-06-06 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Harrison. 4 5 <rdar://problem/4889598> Problems with moveDown: and moveUp: in Notes with ToDos 6 7 The caret would disappear when moving from content above or below 8 a ToDo if that ToDo doesn't have any content in it with the same 9 x position as the caret. That's because closestLeafChildForXPos 10 would return non-editable leaves, and which turn into non-editable 11 VisiblePositions, which are invisible. 12 13 * editing/visible_units.cpp: 14 (WebCore::previousLinePosition): Ask closestLeafForXPos to only 15 return editable leaves. 16 (WebCore::nextLinePosition): Ditto. 17 * rendering/RootInlineBox.cpp: 18 (WebCore::isEditableLeaf): Added. 19 (WebCore::RootInlineBox::closestLeafChildForXPos): If requested, 20 return the closest editable leaf. Removed an early return if the 21 position is before the first leaf, it's not really much of an 22 optimization. 23 * rendering/RootInlineBox.h: 24 1 25 2007-06-06 Sam Weinig <sam@webkit.org> 2 26 -
trunk/WebCore/editing/visible_units.cpp
r21904 r22037 433 433 if (containingBlock->hasOverflowClip()) 434 434 containingBlock->layer()->subtractScrollOffset(absx, absy); 435 RenderObject *renderer = root->closestLeafChildForXPos(x - absx )->object();435 RenderObject *renderer = root->closestLeafChildForXPos(x - absx, isEditablePosition(p))->object(); 436 436 Node* node = renderer->element(); 437 437 if (editingIgnoresContent(node)) … … 503 503 if (containingBlock->hasOverflowClip()) 504 504 containingBlock->layer()->subtractScrollOffset(absx, absy); 505 RenderObject *renderer = root->closestLeafChildForXPos(x - absx )->object();505 RenderObject *renderer = root->closestLeafChildForXPos(x - absx, isEditablePosition(p))->object(); 506 506 Node* node = renderer->element(); 507 507 if (editingIgnoresContent(node)) -
trunk/WebCore/rendering/RootInlineBox.cpp
r21079 r22037 316 316 } 317 317 318 InlineBox* RootInlineBox::closestLeafChildForXPos(int x) 318 bool isEditableLeaf(InlineBox* leaf) 319 { 320 return leaf && leaf->object() && leaf->object()->element() && leaf->object()->element()->isContentEditable(); 321 } 322 323 InlineBox* RootInlineBox::closestLeafChildForXPos(int x, bool onlyEditableLeaves) 319 324 { 320 325 InlineBox* firstLeaf = firstLeafChildAfterBox(); 321 326 InlineBox* lastLeaf = lastLeafChildBeforeBox(); 322 if (firstLeaf == lastLeaf )327 if (firstLeaf == lastLeaf && (!onlyEditableLeaves || isEditableLeaf(firstLeaf))) 323 328 return firstLeaf; 324 329 325 330 // Avoid returning a list marker when possible. 326 if (x <= firstLeaf->m_x && !firstLeaf->object()->isListMarker() )331 if (x <= firstLeaf->m_x && !firstLeaf->object()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(firstLeaf))) 327 332 // The x coordinate is less or equal to left edge of the firstLeaf. 328 333 // Return it. 329 334 return firstLeaf; 330 335 331 if (x >= lastLeaf->m_x + lastLeaf->m_width && !lastLeaf->object()->isListMarker() )336 if (x >= lastLeaf->m_x + lastLeaf->m_width && !lastLeaf->object()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(lastLeaf))) 332 337 // The x coordinate is greater or equal to right edge of the lastLeaf. 333 338 // Return it. 334 339 return lastLeaf; 335 340 341 InlineBox* closestLeaf = lastLeaf; 336 342 for (InlineBox* leaf = firstLeaf; leaf && leaf != lastLeaf; leaf = leaf->nextLeafChild()) { 337 if (!leaf->object()->isListMarker() ) {343 if (!leaf->object()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(leaf))) { 338 344 int leafX = leaf->m_x; 345 closestLeaf = leaf; 339 346 if (x < leafX + leaf->m_width) 340 347 // The x coordinate is less than the right edge of the box. … … 344 351 } 345 352 346 return lastLeaf;353 return closestLeaf; 347 354 } 348 355 -
trunk/WebCore/rendering/RootInlineBox.h
r21079 r22037 121 121 int selectionHeight() { return max(0, selectionBottom() - selectionTop()); } 122 122 123 InlineBox* closestLeafChildForXPos(int x );123 InlineBox* closestLeafChildForXPos(int x, bool onlyEditableLeaves = false); 124 124 125 125 protected:
Note:
See TracChangeset
for help on using the changeset viewer.