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

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

Issue 2393693002: Reformat comments in core/layout/line (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 m_hasAnnotationsAfter(false), 58 m_hasAnnotationsAfter(false),
59 m_lineBreakBidiStatusEor(WTF::Unicode::LeftToRight), 59 m_lineBreakBidiStatusEor(WTF::Unicode::LeftToRight),
60 m_lineBreakBidiStatusLastStrong(WTF::Unicode::LeftToRight), 60 m_lineBreakBidiStatusLastStrong(WTF::Unicode::LeftToRight),
61 m_lineBreakBidiStatusLast(WTF::Unicode::LeftToRight), 61 m_lineBreakBidiStatusLast(WTF::Unicode::LeftToRight),
62 m_isFirstAfterPageBreak(false) 62 m_isFirstAfterPageBreak(false)
63 #if ENABLE(ASSERT) 63 #if ENABLE(ASSERT)
64 , 64 ,
65 m_hasBadChildList(false) 65 m_hasBadChildList(false)
66 #endif 66 #endif
67 { 67 {
68 // Internet Explorer and Firefox always create a marker for list items, even when the list-style-type is none. We do not make a marker 68 // Internet Explorer and Firefox always create a marker for list items, even
69 // in the list-style-type: none case, since it is wasteful to do so. Howeve r, in order to match other browsers we have to pretend like 69 // when the list-style-type is none. We do not make a marker in the
70 // an invisible marker exists. The side effect of having an invisible marke r is that the quirks mode behavior of shrinking lines with no 70 // list-style-type: none case, since it is wasteful to do so.
71 // text children must not apply. This change also means that gaps will exis t between image bullet list items. Even when the list bullet 71 // However, in order to match other browsers we have to pretend like an
72 // is an image, the line is still considered to be immune from the quirk. 72 // invisible marker exists. The side effect of having an invisible marker
73 // is that the quirks mode behavior of shrinking lines with no text children
74 // must not apply. This change also means that gaps will exist between image
75 // bullet list items. Even when the list bullet is an image, the line is
76 // still considered to be immune from the quirk.
73 m_hasTextChildren = lineLayoutItem.style()->display() == EDisplay::ListItem; 77 m_hasTextChildren = lineLayoutItem.style()->display() == EDisplay::ListItem;
74 m_hasTextDescendants = m_hasTextChildren; 78 m_hasTextDescendants = m_hasTextChildren;
75 } 79 }
76 80
77 #if ENABLE(ASSERT) 81 #if ENABLE(ASSERT)
78 ~InlineFlowBox() override; 82 ~InlineFlowBox() override;
79 #endif 83 #endif
80 84
81 #ifndef NDEBUG 85 #ifndef NDEBUG
82 void showLineTreeAndMark(const InlineBox* = nullptr, 86 void showLineTreeAndMark(const InlineBox* = nullptr,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 LayoutUnit& truncatedWidth, 277 LayoutUnit& truncatedWidth,
274 bool&) override; 278 bool&) override;
275 279
276 bool hasTextChildren() const { return m_hasTextChildren; } 280 bool hasTextChildren() const { return m_hasTextChildren; }
277 bool hasTextDescendants() const { return m_hasTextDescendants; } 281 bool hasTextDescendants() const { return m_hasTextDescendants; }
278 void setHasTextDescendants() { m_hasTextDescendants = true; } 282 void setHasTextDescendants() { m_hasTextDescendants = true; }
279 283
280 void checkConsistency() const; 284 void checkConsistency() const;
281 void setHasBadChildList(); 285 void setHasBadChildList();
282 286
283 // Line visual and layout overflow are in the coordinate space of the block. This means that 287 // Line visual and layout overflow are in the coordinate space of the block.
284 // they aren't purely physical directions. For horizontal-tb and vertical-lr t hey will match 288 // This means that they aren't purely physical directions. For horizontal-tb
285 // physical directions, but for vertical-rl, the left/right respectively are f lipped when 289 // and vertical-lr they will match physical directions, but for vertical-rl,
286 // compared to their physical counterparts. For example minX is on the left i n vertical-lr, but 290 // the left/right respectively are flipped when compared to their physical
287 // it is on the right in vertical-rl. 291 // counterparts. For example minX is on the left in vertical-lr, but it is on
292 // the right in vertical-rl.
288 LayoutRect layoutOverflowRect(LayoutUnit lineTop, 293 LayoutRect layoutOverflowRect(LayoutUnit lineTop,
289 LayoutUnit lineBottom) const { 294 LayoutUnit lineBottom) const {
290 return m_overflow ? m_overflow->layoutOverflowRect() 295 return m_overflow ? m_overflow->layoutOverflowRect()
291 : frameRectIncludingLineHeight(lineTop, lineBottom); 296 : frameRectIncludingLineHeight(lineTop, lineBottom);
292 } 297 }
293 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const { 298 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const {
294 if (m_overflow) 299 if (m_overflow)
295 return isHorizontal() ? m_overflow->layoutOverflowRect().y() 300 return isHorizontal() ? m_overflow->layoutOverflowRect().y()
296 : m_overflow->layoutOverflowRect().x(); 301 : m_overflow->layoutOverflowRect().x();
297 return lineTop; 302 return lineTop;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 m_descendantsHaveSameLineHeightAndBaseline = false; 371 m_descendantsHaveSameLineHeightAndBaseline = false;
367 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) 372 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline())
368 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); 373 parent()->clearDescendantsHaveSameLineHeightAndBaseline();
369 } 374 }
370 375
371 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; } 376 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; }
372 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { 377 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) {
373 m_isFirstAfterPageBreak = isFirstAfterPageBreak; 378 m_isFirstAfterPageBreak = isFirstAfterPageBreak;
374 } 379 }
375 380
376 // Some callers (LayoutListItem) needs to set extra overflow on their line box . 381 // Some callers (LayoutListItem) needs to set extra overflow on their line
382 // box.
377 void overrideOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, 383 void overrideOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow,
378 const LayoutRect& logicalVisualOverflow, 384 const LayoutRect& logicalVisualOverflow,
379 LayoutUnit lineTop, 385 LayoutUnit lineTop,
380 LayoutUnit lineBottom) { 386 LayoutUnit lineBottom) {
381 // If we are setting an overflow, then we can't pretend not to have an overf low. 387 // If we are setting an overflow, then we can't pretend not to have an
388 // overflow.
382 clearKnownToHaveNoOverflow(); 389 clearKnownToHaveNoOverflow();
383 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, 390 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow,
384 lineTop, lineBottom); 391 lineTop, lineBottom);
385 } 392 }
386 393
387 private: 394 private:
388 void placeBoxRangeInInlineDirection(InlineBox* firstChild, 395 void placeBoxRangeInInlineDirection(InlineBox* firstChild,
389 InlineBox* lastChild, 396 InlineBox* lastChild,
390 LayoutUnit& logicalLeft, 397 LayoutUnit& logicalLeft,
391 LayoutUnit& minLogicalLeft, 398 LayoutUnit& minLogicalLeft,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 void computeMaxLogicalTop(LayoutUnit& maxLogicalTop) const; 446 void computeMaxLogicalTop(LayoutUnit& maxLogicalTop) const;
440 447
441 private: 448 private:
442 unsigned m_includeLogicalLeftEdge : 1; 449 unsigned m_includeLogicalLeftEdge : 1;
443 unsigned m_includeLogicalRightEdge : 1; 450 unsigned m_includeLogicalRightEdge : 1;
444 unsigned m_hasTextChildren : 1; 451 unsigned m_hasTextChildren : 1;
445 unsigned m_hasTextDescendants : 1; 452 unsigned m_hasTextDescendants : 1;
446 unsigned m_descendantsHaveSameLineHeightAndBaseline : 1; 453 unsigned m_descendantsHaveSameLineHeightAndBaseline : 1;
447 454
448 protected: 455 protected:
449 // The following members are only used by RootInlineBox but moved here to keep the bits packed. 456 // The following members are only used by RootInlineBox but moved here to keep
457 // the bits packed.
450 458
451 // Whether or not this line uses alphabetic or ideographic baselines by defaul t. 459 // Whether or not this line uses alphabetic or ideographic baselines by
460 // default.
452 unsigned m_baselineType : 1; // FontBaseline 461 unsigned m_baselineType : 1; // FontBaseline
453 462
454 // If the line contains any ruby runs, then this will be true. 463 // If the line contains any ruby runs, then this will be true.
455 unsigned m_hasAnnotationsBefore : 1; 464 unsigned m_hasAnnotationsBefore : 1;
456 unsigned m_hasAnnotationsAfter : 1; 465 unsigned m_hasAnnotationsAfter : 1;
457 466
458 unsigned m_lineBreakBidiStatusEor : 5; // WTF::Unicode::Direction 467 unsigned m_lineBreakBidiStatusEor : 5; // WTF::Unicode::Direction
459 unsigned m_lineBreakBidiStatusLastStrong : 5; // WTF::Unicode::Direction 468 unsigned m_lineBreakBidiStatusLastStrong : 5; // WTF::Unicode::Direction
460 unsigned m_lineBreakBidiStatusLast : 5; // WTF::Unicode::Direction 469 unsigned m_lineBreakBidiStatusLast : 5; // WTF::Unicode::Direction
461 470
(...skipping 15 matching lines...) Expand all
477 486
478 inline void InlineFlowBox::setHasBadChildList() { 487 inline void InlineFlowBox::setHasBadChildList() {
479 #if ENABLE(ASSERT) 488 #if ENABLE(ASSERT)
480 m_hasBadChildList = true; 489 m_hasBadChildList = true;
481 #endif 490 #endif
482 } 491 }
483 492
484 } // namespace blink 493 } // namespace blink
485 494
486 #endif // InlineFlowBox_h 495 #endif // InlineFlowBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698