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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.h

Issue 1957633003: Move line-specific code into LayoutBlockFlow::positionForPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | third_party/WebKit/Source/core/layout/LayoutBlock.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 public: 424 public:
425 bool hasCursorCaret() const; 425 bool hasCursorCaret() const;
426 bool hasDragCaret() const; 426 bool hasDragCaret() const;
427 bool hasCaret() const { return hasCursorCaret() || hasDragCaret(); } 427 bool hasCaret() const { return hasCursorCaret() || hasDragCaret(); }
428 428
429 private: 429 private:
430 LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidt hToEndOfLine = nullptr) final; 430 LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidt hToEndOfLine = nullptr) final;
431 bool isInlineBoxWrapperActuallyChild() const; 431 bool isInlineBoxWrapperActuallyChild() const;
432 432
433 Position positionForBox(InlineBox*, bool start = true) const; 433 Position positionForBox(InlineBox*, bool start = true) const;
434 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&);
435 434
436 // End helper functions and structs used by layoutBlockChildren. 435 // End helper functions and structs used by layoutBlockChildren.
437 436
438 void removeFromGlobalMaps(); 437 void removeFromGlobalMaps();
439 bool widthAvailableToChildrenHasChanged(); 438 bool widthAvailableToChildrenHasChanged();
440 439
441 public: 440 public:
442 // Specify which page or column to associate with an offset, if said offset is exactly at a page 441 // Specify which page or column to associate with an offset, if said offset is exactly at a page
443 // or column boundary. 442 // or column boundary.
444 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage }; 443 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage };
(...skipping 23 matching lines...) Expand all
468 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule) co nst; 467 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule) co nst;
469 468
470 // Paginated content inside this block was laid out. 469 // Paginated content inside this block was laid out.
471 // |logicalBottomOffsetAfterPagination| is the logical bottom offset of the child content after 470 // |logicalBottomOffsetAfterPagination| is the logical bottom offset of the child content after
472 // applying any forced or unforced breaks as needed. 471 // applying any forced or unforced breaks as needed.
473 void paginatedContentWasLaidOut(LayoutUnit logicalBottomOffsetAfterPaginatio n); 472 void paginatedContentWasLaidOut(LayoutUnit logicalBottomOffsetAfterPaginatio n);
474 473
475 // Adjust from painting offsets to the local coords of this layoutObject 474 // Adjust from painting offsets to the local coords of this layoutObject
476 void offsetForContents(LayoutPoint&) const; 475 void offsetForContents(LayoutPoint&) const;
477 476
477 PositionWithAffinity positionForPointRespectingEditingBoundaries(LineLayoutB ox child, const LayoutPoint& pointInParentCoordinates);
478 PositionWithAffinity positionForPointIfOutsideAtomicInlineLevel(const Layout Point&);
479
478 virtual bool updateLogicalWidthAndColumnWidth(); 480 virtual bool updateLogicalWidthAndColumnWidth();
479 481
480 virtual bool canCollapseAnonymousBlockChild() const { return true; } 482 virtual bool canCollapseAnonymousBlockChild() const { return true; }
481 483
482 LayoutObjectChildList m_children; 484 LayoutObjectChildList m_children;
483 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc k flow. For example, <div>Hello<br>world.</div> will have two total lines for t he <div>. 485 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc k flow. For example, <div>Hello<br>world.</div> will have two total lines for t he <div>.
484 486
485 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in LayoutBlockRareData since they are set too frequently. 487 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in LayoutBlockRareData since they are set too frequently.
486 unsigned m_hasMarginAfterQuirk : 1; 488 unsigned m_hasMarginAfterQuirk : 1;
487 unsigned m_beingDestroyed : 1; 489 unsigned m_beingDestroyed : 1;
(...skipping 15 matching lines...) Expand all
503 // FIXME: This is temporary as we move code that accesses block flow 505 // FIXME: This is temporary as we move code that accesses block flow
504 // member variables out of LayoutBlock and into LayoutBlockFlow. 506 // member variables out of LayoutBlock and into LayoutBlockFlow.
505 friend class LayoutBlockFlow; 507 friend class LayoutBlockFlow;
506 }; 508 };
507 509
508 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 510 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
509 511
510 } // namespace blink 512 } // namespace blink
511 513
512 #endif // LayoutBlock_h 514 #endif // LayoutBlock_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698