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

Side by Side Diff: Source/core/rendering/RenderBlock.h

Issue 268833003: Refactor avoidsFloats() to reflect CSS2.1 spec more clearly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 1 month 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 | Annotate | Revision Log
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride; 312 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride;
313 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride; 313 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride;
314 314
315 virtual bool hasLineIfEmpty() const; 315 virtual bool hasLineIfEmpty() const;
316 316
317 bool simplifiedLayout(); 317 bool simplifiedLayout();
318 virtual void simplifiedNormalFlowLayout(); 318 virtual void simplifiedNormalFlowLayout();
319 319
320 void setDesiredColumnCountAndWidth(int, LayoutUnit); 320 void setDesiredColumnCountAndWidth(int, LayoutUnit);
321 321
322 bool avoidsOrIgnoresFloats() { return isFloatingOrOutOfFlowPositioned() || a voidsFloats(); }
322 public: 323 public:
323 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); 324 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false);
324 protected: 325 protected:
325 virtual void addOverflowFromChildren(); 326 virtual void addOverflowFromChildren();
326 void addOverflowFromPositionedObjects(); 327 void addOverflowFromPositionedObjects();
327 void addOverflowFromBlockChildren(); 328 void addOverflowFromBlockChildren();
328 void addVisualOverflowFromTheme(); 329 void addVisualOverflowFromTheme();
329 330
330 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset, const RenderLayerModelObject* paintContainer) const override; 331 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset, const RenderLayerModelObject* paintContainer) const override;
331 332
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants Map*&, TrackedContainerMap*&); 364 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants Map*&, TrackedContainerMap*&);
364 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc endantsMap*&, TrackedContainerMap*&); 365 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc endantsMap*&, TrackedContainerMap*&);
365 366
366 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderText& c urrentChild, unsigned length); 367 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderText& c urrentChild, unsigned length);
367 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi rstLetterContainer); 368 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi rstLetterContainer);
368 bool isInvalidFirstLetterRenderer(RenderObject*) const; 369 bool isInvalidFirstLetterRenderer(RenderObject*) const;
369 370
370 Node* nodeForHitTest() const; 371 Node* nodeForHitTest() const;
371 372
372 private: 373 private:
373 virtual bool avoidsFloats() const override { return true; }
374 374
375 bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLoca tion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); 375 bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLoca tion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
376 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) ; 376 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) ;
377 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow 377 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow
378 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT estLocation&, const LayoutPoint&) { return false; } 378 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT estLocation&, const LayoutPoint&) { return false; }
379 379
380 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc ationInContainer, const LayoutPoint& accumulatedOffset); 380 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc ationInContainer, const LayoutPoint& accumulatedOffset);
381 381
382 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU nit& maxLogicalWidth) const; 382 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU nit& maxLogicalWidth) const;
383 383
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 protected: 439 protected:
440 // Returns the logicalOffset at the top of the next page. If the offset pass ed in is already at the top of the current page, 440 // Returns the logicalOffset at the top of the next page. If the offset pass ed in is already at the top of the current page,
441 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t op of the next page. nextPageLogicalTop with 441 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t op of the next page. nextPageLogicalTop with
442 // IncludePageBoundary set will not. 442 // IncludePageBoundary set will not.
443 // 443 //
444 // For a page height of 800px, the first rule will return 800 if the value p assed in is 0. The second rule will simply return 0. 444 // For a page height of 800px, the first rule will return 800 if the value p assed in is 0. The second rule will simply return 0.
445 enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary }; 445 enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary };
446 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = E xcludePageBoundary) const; 446 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = E xcludePageBoundary) const;
447 447
448 bool createsBlockFormattingContext() const;
449
450 public: 448 public:
451 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; 449 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const;
452 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBounda ryRule = IncludePageBoundary) const; 450 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBounda ryRule = IncludePageBoundary) const;
453 451
454 protected: 452 protected:
455 // A page break is required at some offset due to space shortage in the curr ent fragmentainer. 453 // A page break is required at some offset due to space shortage in the curr ent fragmentainer.
456 void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage); 454 void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage);
457 455
458 // Update minimum page height required to avoid fragmentation where it shoul dn't occur (inside 456 // Update minimum page height required to avoid fragmentation where it shoul dn't occur (inside
459 // unbreakable content, between orphans and widows, etc.). This will be used as a hint to the 457 // unbreakable content, between orphans and widows, etc.). This will be used as a hint to the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 // FIXME: This is temporary as we move code that accesses block flow 493 // FIXME: This is temporary as we move code that accesses block flow
496 // member variables out of RenderBlock and into RenderBlockFlow. 494 // member variables out of RenderBlock and into RenderBlockFlow.
497 friend class RenderBlockFlow; 495 friend class RenderBlockFlow;
498 }; 496 };
499 497
500 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); 498 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock());
501 499
502 } // namespace blink 500 } // namespace blink
503 501
504 #endif // RenderBlock_h 502 #endif // RenderBlock_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/float/block-formatting-context-crash-expected.txt ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698