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

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

Issue 23737004: Paint flex items atomically, like inline-blocks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderFlexibleBox.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, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 paintChild(child, paintInfo, paintOffset); 3102 paintChild(child, paintInfo, paintOffset);
3103 } 3103 }
3104 3104
3105 void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layou tPoint& paintOffset) 3105 void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layou tPoint& paintOffset)
3106 { 3106 {
3107 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset); 3107 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset);
3108 if (!child->hasSelfPaintingLayer() && !child->isFloating()) 3108 if (!child->hasSelfPaintingLayer() && !child->isFloating())
3109 child->paint(paintInfo, childPoint); 3109 child->paint(paintInfo, childPoint);
3110 } 3110 }
3111 3111
3112 void RenderBlock::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInfo , const LayoutPoint& paintOffset)
3113 {
3114 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset);
3115 if (!child->hasSelfPaintingLayer() && !child->isFloating())
3116 paintAsInlineBlock(child, paintInfo, childPoint);
3117 }
3118
3119 void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInf o, const LayoutPoint& childPoint)
3120 {
3121 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection)
3122 return;
3123
3124 // Paint all phases of replaced elements atomically, as though the replaced element established its
ojan 2013/08/29 23:46:05 Not sure this comment is still right...it's not ju
cbiesinger 2013/08/30 17:33:50 Updated this comment. I also added a comment to th
3125 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab le elements in the CSS2.1
3126 // specification.)
3127 bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.pha se == PaintPhaseTextClip;
3128 PaintInfo info(paintInfo);
3129 info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
3130 renderer->paint(info, childPoint);
3131 if (!preservePhase) {
3132 info.phase = PaintPhaseChildBlockBackgrounds;
3133 renderer->paint(info, childPoint);
3134 info.phase = PaintPhaseFloat;
3135 renderer->paint(info, childPoint);
3136 info.phase = PaintPhaseForeground;
3137 renderer->paint(info, childPoint);
3138 info.phase = PaintPhaseOutline;
3139 renderer->paint(info, childPoint);
3140 }
3141 }
3142
3112 bool RenderBlock::hasCaret(CaretType type) const 3143 bool RenderBlock::hasCaret(CaretType type) const
3113 { 3144 {
3114 // Paint the caret if the FrameSelection says so or if caret browsing is ena bled 3145 // Paint the caret if the FrameSelection says so or if caret browsing is ena bled
3115 bool caretBrowsing = frame()->settings() && frame()->settings()->caretBrowsi ngEnabled(); 3146 bool caretBrowsing = frame()->settings() && frame()->settings()->caretBrowsi ngEnabled();
3116 RenderObject* caretPainter; 3147 RenderObject* caretPainter;
3117 bool isContentEditable; 3148 bool isContentEditable;
3118 if (type == CursorCaret) { 3149 if (type == CursorCaret) {
3119 caretPainter = frame()->selection()->caretRenderer(); 3150 caretPainter = frame()->selection()->caretRenderer();
3120 isContentEditable = frame()->selection()->rendererIsEditable(); 3151 isContentEditable = frame()->selection()->rendererIsEditable();
3121 } else { 3152 } else {
(...skipping 4855 matching lines...) Expand 10 before | Expand all | Expand 10 after
7977 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 8008 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
7978 { 8009 {
7979 showRenderObject(); 8010 showRenderObject();
7980 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 8011 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
7981 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 8012 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
7982 } 8013 }
7983 8014
7984 #endif 8015 #endif
7985 8016
7986 } // namespace WebCore 8017 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698