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

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

Issue 1819073004: Fix table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr fixes, remove tiling algorithm Created 4 years, 8 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserv ed.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 bool hasMultipleCellLevels() const { return m_hasMultipleCellLevels; } 306 bool hasMultipleCellLevels() const { return m_hasMultipleCellLevels; }
307 307
308 const char* name() const override { return "LayoutTableSection"; } 308 const char* name() const override { return "LayoutTableSection"; }
309 309
310 // Whether a section has opaque background depends on many factors, e.g. bor der spacing, 310 // Whether a section has opaque background depends on many factors, e.g. bor der spacing,
311 // border collapsing, missing cells, etc. 311 // border collapsing, missing cells, etc.
312 // For simplicity, just conservatively assume all table sections are not opa que. 312 // For simplicity, just conservatively assume all table sections are not opa que.
313 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect&, unsigned) const ov erride { return false; } 313 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect&, unsigned) const ov erride { return false; }
314 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const override { r eturn false; } 314 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const override { r eturn false; }
315 315
316
317 // Returns cell's position.
318 LayoutRect getCellPhysicalPosition(unsigned row, unsigned effectiveColumn) c onst;
319
320 // Returns table-relative position.
321 LayoutRect positionForBackgroundDrawing() const;
322
316 protected: 323 protected:
317 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 324 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
318 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; 325 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
319 326
320 private: 327 private:
321 LayoutObjectChildList* virtualChildren() override { return children(); } 328 LayoutObjectChildList* virtualChildren() override { return children(); }
322 const LayoutObjectChildList* virtualChildren() const override { return child ren(); } 329 const LayoutObjectChildList* virtualChildren() const override { return child ren(); }
323 330
324 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectTableSection || LayoutBox::isOfType(type); } 331 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectTableSection || LayoutBox::isOfType(type); }
325 332
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); } 364 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); }
358 CellSpan fullTableEffectiveColumnSpan() const { return CellSpan(0, table()-> numEffectiveColumns()); } 365 CellSpan fullTableEffectiveColumnSpan() const { return CellSpan(0, table()-> numEffectiveColumns()); }
359 366
360 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection. 367 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection.
361 // The returned span of rows or columns is end-exclusive, and empty if start ==end. 368 // The returned span of rows or columns is end-exclusive, and empty if start ==end.
362 CellSpan spannedRows(const LayoutRect& flippedRect) const; 369 CellSpan spannedRows(const LayoutRect& flippedRect) const;
363 CellSpan spannedEffectiveColumns(const LayoutRect& flippedRect) const; 370 CellSpan spannedEffectiveColumns(const LayoutRect& flippedRect) const;
364 371
365 void setLogicalPositionForCell(LayoutTableCell*, unsigned effectiveColumn) c onst; 372 void setLogicalPositionForCell(LayoutTableCell*, unsigned effectiveColumn) c onst;
366 373
374 LayoutRect mapLogicalToPhysicalPosition(const LayoutRect& position) const;
375
376 // Returns cell's position without taking writing-mode or direction
377 // into account.
378 LayoutRect getCellPosition(unsigned row, unsigned effectiveColumn) const;
379
367 LayoutObjectChildList m_children; 380 LayoutObjectChildList m_children;
368 381
369 // The representation of the rows and their cells (CellStruct). 382 // The representation of the rows and their cells (CellStruct).
370 Vector<RowStruct> m_grid; 383 Vector<RowStruct> m_grid;
371 384
372 // The logical offset of each row from the top of the section. 385 // The logical offset of each row from the top of the section.
373 // 386 //
374 // Note that this Vector has one more entry than the number of rows so that 387 // Note that this Vector has one more entry than the number of rows so that
375 // we can keep track of the final size of the section 388 // we can keep track of the final size of the section
376 // (m_rowPos[m_grid.size() + 1]). 389 // (m_rowPos[m_grid.size() + 1]).
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // Invisible borders are never stored in this map. 430 // Invisible borders are never stored in this map.
418 using CellsCollapsedBordersMap = HashMap<std::pair<const LayoutTableCell*, i nt>, CollapsedBorderValue>; 431 using CellsCollapsedBordersMap = HashMap<std::pair<const LayoutTableCell*, i nt>, CollapsedBorderValue>;
419 CellsCollapsedBordersMap m_cellsCollapsedBorders; 432 CellsCollapsedBordersMap m_cellsCollapsedBorders;
420 }; 433 };
421 434
422 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); 435 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection());
423 436
424 } // namespace blink 437 } // namespace blink
425 438
426 #endif // LayoutTableSection_h 439 #endif // LayoutTableSection_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableRow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698