Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 return toElement(n); | 344 return toElement(n); |
| 345 } | 345 } |
| 346 return 0; | 346 return 0; |
| 347 } | 347 } |
| 348 | 348 |
| 349 bool inSameContainingBlockFlowElement(Node* a, Node* b) | 349 bool inSameContainingBlockFlowElement(Node* a, Node* b) |
| 350 { | 350 { |
| 351 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement( *b); | 351 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement( *b); |
| 352 } | 352 } |
| 353 | 353 |
| 354 TextDirection directionOfEnclosingBlock(const Position& position) | 354 bool isEnclosingBoxHasLeftToRightDirection(const Position& position) |
|
leviw_travelin_and_unemployed
2014/10/14 23:04:40
Why are you changing this function? isEnclosingBox
yosin_UTC9
2014/10/15 00:55:22
Since |TextDirection| has two values, |LTR| and |R
Habib Virji
2014/10/16 15:55:09
Done.
| |
| 355 { | 355 { |
| 356 Element* enclosingBlockElement = enclosingBlock(position.containerNode()); | 356 Element* enclosingBlockElement = enclosingBlock(position.containerNode()); |
| 357 if (!enclosingBlockElement) | 357 if (!enclosingBlockElement) |
| 358 return LTR; | 358 return true; |
| 359 RenderObject* renderer = enclosingBlockElement->renderer(); | 359 RenderObject* renderer = enclosingBlockElement->renderer(); |
| 360 return renderer ? renderer->style()->direction() : LTR; | 360 return !renderer || renderer->style()->direction() == LTR; |
| 361 } | 361 } |
| 362 | 362 |
| 363 // This method is used to create positions in the DOM. It returns the maximum va lid offset | 363 // This method is used to create positions in the DOM. It returns the maximum va lid offset |
| 364 // in a node. It returns 1 for some elements even though they do not have childr en, which | 364 // in a node. It returns 1 for some elements even though they do not have childr en, which |
| 365 // creates technically invalid DOM Positions. Be sure to call parentAnchoredEqui valent | 365 // creates technically invalid DOM Positions. Be sure to call parentAnchoredEqui valent |
| 366 // on a Position before using it to create a DOM Range, or an exception will be thrown. | 366 // on a Position before using it to create a DOM Range, or an exception will be thrown. |
| 367 int lastOffsetForEditing(const Node* node) | 367 int lastOffsetForEditing(const Node* node) |
| 368 { | 368 { |
| 369 ASSERT(node); | 369 ASSERT(node); |
| 370 if (!node) | 370 if (!node) |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1225 // if the selection starts just before a paragraph break, skip over it | 1225 // if the selection starts just before a paragraph break, skip over it |
| 1226 if (isEndOfParagraph(visiblePosition)) | 1226 if (isEndOfParagraph(visiblePosition)) |
| 1227 return visiblePosition.next().deepEquivalent().downstream(); | 1227 return visiblePosition.next().deepEquivalent().downstream(); |
| 1228 | 1228 |
| 1229 // otherwise, make sure to be at the start of the first selected node, | 1229 // otherwise, make sure to be at the start of the first selected node, |
| 1230 // instead of possibly at the end of the last node before the selection | 1230 // instead of possibly at the end of the last node before the selection |
| 1231 return visiblePosition.deepEquivalent().downstream(); | 1231 return visiblePosition.deepEquivalent().downstream(); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 } // namespace blink | 1234 } // namespace blink |
| OLD | NEW |