| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 400 |
| 401 bool DirOverride() const { return bitfields_.DirOverride(); } | 401 bool DirOverride() const { return bitfields_.DirOverride(); } |
| 402 void SetDirOverride(bool dir_override) { | 402 void SetDirOverride(bool dir_override) { |
| 403 bitfields_.SetDirOverride(dir_override); | 403 bitfields_.SetDirOverride(dir_override); |
| 404 } | 404 } |
| 405 | 405 |
| 406 // Set all LineLayoutItems in the inline box subtree should do full paint | 406 // Set all LineLayoutItems in the inline box subtree should do full paint |
| 407 // invalidation. | 407 // invalidation. |
| 408 void SetShouldDoFullPaintInvalidationRecursively(); | 408 void SetShouldDoFullPaintInvalidationRecursively(); |
| 409 | 409 |
| 410 #define ADD_BOOLEAN_BITFIELD(name, Name) \ | 410 #define ADD_BOOLEAN_BITFIELD(field_name_, MethodNameBase) \ |
| 411 private: \ | 411 private: \ |
| 412 unsigned m_##name : 1; \ | 412 unsigned field_name_ : 1; \ |
| 413 \ | 413 \ |
| 414 public: \ | 414 public: \ |
| 415 bool name() const { return m_##name; } \ | 415 bool MethodNameBase() const { return field_name_; } \ |
| 416 void Set##Name(bool name) { m_##name = name; } | 416 void Set##MethodNameBase(bool new_value) { field_name_ = new_value; } |
| 417 | 417 |
| 418 class InlineBoxBitfields { | 418 class InlineBoxBitfields { |
| 419 DISALLOW_NEW(); | 419 DISALLOW_NEW(); |
| 420 | 420 |
| 421 public: | 421 public: |
| 422 InlineBoxBitfields(bool first_line = false, | 422 InlineBoxBitfields(bool first_line = false, |
| 423 bool constructed = false, | 423 bool constructed = false, |
| 424 bool dirty = false, | 424 bool dirty = false, |
| 425 bool extracted = false, | 425 bool extracted = false, |
| 426 bool is_horizontal = true) | 426 bool is_horizontal = true) |
| 427 : m_FirstLine(first_line), | 427 : first_line_(first_line), |
| 428 m_Constructed(constructed), | 428 constructed_(constructed), |
| 429 bidi_embedding_level_(0), | 429 bidi_embedding_level_(0), |
| 430 m_Dirty(dirty), | 430 dirty_(dirty), |
| 431 m_Extracted(extracted), | 431 extracted_(extracted), |
| 432 m_HasVirtualLogicalHeight(false), | 432 has_virtual_logical_height_(false), |
| 433 m_IsHorizontal(is_horizontal), | 433 is_horizontal_(is_horizontal), |
| 434 m_EndsWithBreak(false), | 434 ends_with_break_(false), |
| 435 m_HasSelectedChildrenOrCanHaveLeadingExpansion(false), | 435 has_selected_children_or_can_have_leading_expansion_(false), |
| 436 m_KnownToHaveNoOverflow(true), | 436 known_to_have_no_overflow_(true), |
| 437 m_HasEllipsisBoxOrHyphen(false), | 437 has_ellipsis_box_or_hyphen_(false), |
| 438 m_DirOverride(false), | 438 dir_override_(false), |
| 439 m_IsText(false), | 439 is_text_(false), |
| 440 expansion_(0) {} | 440 expansion_(0) {} |
| 441 | 441 |
| 442 // Some of these bits are actually for subclasses and moved here to compact | 442 // Some of these bits are actually for subclasses and moved here to compact |
| 443 // the structures. | 443 // the structures. |
| 444 // for this class | 444 // for this class |
| 445 ADD_BOOLEAN_BITFIELD(FirstLine, FirstLine); | 445 ADD_BOOLEAN_BITFIELD(first_line_, FirstLine); |
| 446 ADD_BOOLEAN_BITFIELD(Constructed, Constructed); | 446 ADD_BOOLEAN_BITFIELD(constructed_, Constructed); |
| 447 | 447 |
| 448 private: | 448 private: |
| 449 // The maximium bidi level is 62: | 449 // The maximium bidi level is 62: |
| 450 // http://unicode.org/reports/tr9/#Explicit_Levels_and_Directions | 450 // http://unicode.org/reports/tr9/#Explicit_Levels_and_Directions |
| 451 unsigned bidi_embedding_level_ : 6; | 451 unsigned bidi_embedding_level_ : 6; |
| 452 | 452 |
| 453 public: | 453 public: |
| 454 unsigned char BidiEmbeddingLevel() const { return bidi_embedding_level_; } | 454 unsigned char BidiEmbeddingLevel() const { return bidi_embedding_level_; } |
| 455 void SetBidiEmbeddingLevel(unsigned char bidi_embedding_level) { | 455 void SetBidiEmbeddingLevel(unsigned char bidi_embedding_level) { |
| 456 bidi_embedding_level_ = bidi_embedding_level; | 456 bidi_embedding_level_ = bidi_embedding_level; |
| 457 } | 457 } |
| 458 | 458 |
| 459 ADD_BOOLEAN_BITFIELD(Dirty, Dirty); | 459 ADD_BOOLEAN_BITFIELD(dirty_, Dirty); |
| 460 ADD_BOOLEAN_BITFIELD(Extracted, Extracted); | 460 ADD_BOOLEAN_BITFIELD(extracted_, Extracted); |
| 461 ADD_BOOLEAN_BITFIELD(HasVirtualLogicalHeight, HasVirtualLogicalHeight); | 461 ADD_BOOLEAN_BITFIELD(has_virtual_logical_height_, HasVirtualLogicalHeight); |
| 462 ADD_BOOLEAN_BITFIELD(IsHorizontal, IsHorizontal); | 462 ADD_BOOLEAN_BITFIELD(is_horizontal_, IsHorizontal); |
| 463 // for RootInlineBox | 463 // for RootInlineBox |
| 464 ADD_BOOLEAN_BITFIELD(EndsWithBreak, | 464 ADD_BOOLEAN_BITFIELD(ends_with_break_, |
| 465 EndsWithBreak); // Whether the line ends with a <br>. | 465 EndsWithBreak); // Whether the line ends with a <br>. |
| 466 // shared between RootInlineBox and InlineTextBox | 466 // shared between RootInlineBox and InlineTextBox |
| 467 ADD_BOOLEAN_BITFIELD(HasSelectedChildrenOrCanHaveLeadingExpansion, | 467 ADD_BOOLEAN_BITFIELD(has_selected_children_or_can_have_leading_expansion_, |
| 468 HasSelectedChildrenOrCanHaveLeadingExpansion); | 468 HasSelectedChildrenOrCanHaveLeadingExpansion); |
| 469 | 469 |
| 470 // This boolean will never be set if there is potential for overflow, but it | 470 // This boolean will never be set if there is potential for overflow, but it |
| 471 // will be eagerly cleared in the opposite case. As such, it's a | 471 // will be eagerly cleared in the opposite case. As such, it's a |
| 472 // conservative tracking of the absence of overflow. | 472 // conservative tracking of the absence of overflow. |
| 473 // | 473 // |
| 474 // For whether we have overflow, callers should use m_overflow on | 474 // For whether we have overflow, callers should use |overflow_| on |
| 475 // InlineFlowBox. | 475 // InlineFlowBox. |
| 476 ADD_BOOLEAN_BITFIELD(KnownToHaveNoOverflow, KnownToHaveNoOverflow); | 476 ADD_BOOLEAN_BITFIELD(known_to_have_no_overflow_, KnownToHaveNoOverflow); |
| 477 ADD_BOOLEAN_BITFIELD(HasEllipsisBoxOrHyphen, HasEllipsisBoxOrHyphen); | 477 ADD_BOOLEAN_BITFIELD(has_ellipsis_box_or_hyphen_, HasEllipsisBoxOrHyphen); |
| 478 // for InlineTextBox | 478 // for InlineTextBox |
| 479 ADD_BOOLEAN_BITFIELD(DirOverride, DirOverride); | 479 ADD_BOOLEAN_BITFIELD(dir_override_, DirOverride); |
| 480 // Whether or not this object represents text with a non-zero height. | 480 // Whether or not this object represents text with a non-zero height. |
| 481 // Includes non-image list markers, text boxes. | 481 // Includes non-image list markers, text boxes. |
| 482 ADD_BOOLEAN_BITFIELD(IsText, IsText); | 482 ADD_BOOLEAN_BITFIELD(is_text_, IsText); |
| 483 | 483 |
| 484 private: | 484 private: |
| 485 unsigned expansion_ : 12; // for justified text | 485 unsigned expansion_ : 12; // for justified text |
| 486 | 486 |
| 487 public: | 487 public: |
| 488 signed Expansion() const { return expansion_; } | 488 signed Expansion() const { return expansion_; } |
| 489 void SetExpansion(signed expansion) { expansion_ = expansion; } | 489 void SetExpansion(signed expansion) { expansion_ = expansion; } |
| 490 }; | 490 }; |
| 491 #undef ADD_BOOLEAN_BITFIELD | 491 #undef ADD_BOOLEAN_BITFIELD |
| 492 | 492 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 | 566 |
| 567 } // namespace blink | 567 } // namespace blink |
| 568 | 568 |
| 569 #ifndef NDEBUG | 569 #ifndef NDEBUG |
| 570 // Outside the WebCore namespace for ease of invocation from gdb. | 570 // Outside the WebCore namespace for ease of invocation from gdb. |
| 571 void showTree(const blink::InlineBox*); | 571 void showTree(const blink::InlineBox*); |
| 572 void showLineTree(const blink::InlineBox*); | 572 void showLineTree(const blink::InlineBox*); |
| 573 #endif | 573 #endif |
| 574 | 574 |
| 575 #endif // InlineBox_h | 575 #endif // InlineBox_h |
| OLD | NEW |