Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 1302713002: Move computeInlineBoxPosition() out from VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T13:39:17 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/editing/RenderedPosition.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 TextDirection FrameSelection::directionOfSelection() 522 TextDirection FrameSelection::directionOfSelection()
523 { 523 {
524 InlineBox* startBox = nullptr; 524 InlineBox* startBox = nullptr;
525 InlineBox* endBox = nullptr; 525 InlineBox* endBox = nullptr;
526 // Cache the VisiblePositions because visibleStart() and visibleEnd() 526 // Cache the VisiblePositions because visibleStart() and visibleEnd()
527 // can cause layout, which has the potential to invalidate lineboxes. 527 // can cause layout, which has the potential to invalidate lineboxes.
528 VisiblePosition startPosition = m_selection.visibleStart(); 528 VisiblePosition startPosition = m_selection.visibleStart();
529 VisiblePosition endPosition = m_selection.visibleEnd(); 529 VisiblePosition endPosition = m_selection.visibleEnd();
530 if (startPosition.isNotNull()) 530 if (startPosition.isNotNull())
531 startBox = startPosition.computeInlineBoxPosition().inlineBox; 531 startBox = computeInlineBoxPosition(startPosition).inlineBox;
532 if (endPosition.isNotNull()) 532 if (endPosition.isNotNull())
533 endBox = endPosition.computeInlineBoxPosition().inlineBox; 533 endBox = computeInlineBoxPosition(endPosition).inlineBox;
534 if (startBox && endBox && startBox->direction() == endBox->direction()) 534 if (startBox && endBox && startBox->direction() == endBox->direction())
535 return startBox->direction(); 535 return startBox->direction();
536 536
537 return directionOfEnclosingBlock(); 537 return directionOfEnclosingBlock();
538 } 538 }
539 539
540 void FrameSelection::didChangeFocus() 540 void FrameSelection::didChangeFocus()
541 { 541 {
542 // Hits in virtual/gpu/compositedscrolling/scrollbars/scrollbar-miss-mousemo ve-disabled.html 542 // Hits in virtual/gpu/compositedscrolling/scrollbars/scrollbar-miss-mousemo ve-disabled.html
543 DisableCompositingQueryAsserts disabler; 543 DisableCompositingQueryAsserts disabler;
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2057
2058 void showTree(const blink::FrameSelection* sel) 2058 void showTree(const blink::FrameSelection* sel)
2059 { 2059 {
2060 if (sel) 2060 if (sel)
2061 sel->showTreeForThis(); 2061 sel->showTreeForThis();
2062 else 2062 else
2063 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 2063 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
2064 } 2064 }
2065 2065
2066 #endif 2066 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/RenderedPosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698