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

Side by Side Diff: Source/core/rendering/shapes/ShapeOutsideInfo.cpp

Issue 237313003: CSS shapes support in Web Inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments Created 6 years, 7 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
« no previous file with comments | « Source/core/rendering/shapes/ShapeOutsideInfo.h ('k') | Source/devtools/Inspector-1.1.json » ('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) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 // Lines that do not overlap the shape should act as if the float 301 // Lines that do not overlap the shape should act as if the float
302 // wasn't there for layout purposes. So we set the deltas to remove the 302 // wasn't there for layout purposes. So we set the deltas to remove the
303 // entire width of the float. 303 // entire width of the float.
304 m_leftMarginBoxDelta = floatMarginBoxWidth; 304 m_leftMarginBoxDelta = floatMarginBoxWidth;
305 m_rightMarginBoxDelta = -floatMarginBoxWidth; 305 m_rightMarginBoxDelta = -floatMarginBoxWidth;
306 m_lineOverlapsShape = false; 306 m_lineOverlapsShape = false;
307 } 307 }
308 } 308 }
309 309
310 LayoutRect ShapeOutsideInfo::computedShapePhysicalBoundingBox() const
311 {
312 LayoutRect physicalBoundingBox = computedShape().shapeMarginLogicalBoundingB ox();
313 physicalBoundingBox.setX(physicalBoundingBox.x() + logicalLeftOffset());
314
315 if (m_renderer.style()->isFlippedBlocksWritingMode())
316 physicalBoundingBox.setY(m_renderer.logicalHeight() - physicalBoundingBo x.maxY());
317 else
318 physicalBoundingBox.setY(physicalBoundingBox.y() + logicalTopOffset());
319
320 if (!m_renderer.style()->isHorizontalWritingMode())
321 physicalBoundingBox = physicalBoundingBox.transposedRect();
322 else
323 physicalBoundingBox.setY(physicalBoundingBox.y() + logicalTopOffset());
apavlov 2014/05/06 12:08:35 Great, that's exactly what I meant! I have a quic
Habib Virji 2014/05/06 12:25:41 Relation between isFlippedBlocksWritingMode() and
apavlov 2014/05/06 12:30:29 Sure. The best approach here is to try coming up w
324
325 return physicalBoundingBox;
310 } 326 }
327
328 FloatPoint ShapeOutsideInfo::shapeToRendererPoint(FloatPoint point) const
329 {
330 FloatPoint result = FloatPoint(point.x() + logicalLeftOffset(), point.y() + logicalTopOffset());
331 if (m_renderer.style()->isFlippedBlocksWritingMode())
332 result.setY(m_renderer.logicalHeight() - result.y());
333 if (!m_renderer.style()->isHorizontalWritingMode())
334 result = result.transposedPoint();
335 return result;
336 }
337
338 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const
339 {
340 if (!m_renderer.style()->isHorizontalWritingMode())
341 return size.transposedSize();
342 return size;
343 }
344
345 }
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/ShapeOutsideInfo.h ('k') | Source/devtools/Inspector-1.1.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698