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

Side by Side Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 703563002: Remove shape-outside. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/line/LineWidth.h » ('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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 1759
1760 RefPtr<RenderStyle> oldStyle = m_style.release(); 1760 RefPtr<RenderStyle> oldStyle = m_style.release();
1761 setStyleInternal(style); 1761 setStyleInternal(style);
1762 1762
1763 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers()); 1763 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers());
1764 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ()); 1764 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ());
1765 1765
1766 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image()); 1766 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image());
1767 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image()); 1767 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image());
1768 1768
1769 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts ide());
1770
1771 bool doesNotNeedLayout = !m_parent || isText(); 1769 bool doesNotNeedLayout = !m_parent || isText();
1772 1770
1773 styleDidChange(diff, oldStyle.get()); 1771 styleDidChange(diff, oldStyle.get());
1774 1772
1775 // FIXME: |this| might be destroyed here. This can currently happen for a Re nderTextFragment when 1773 // FIXME: |this| might be destroyed here. This can currently happen for a Re nderTextFragment when
1776 // its first-letter block gets an update in RenderTextFragment::styleDidChan ge. For RenderTextFragment(s), 1774 // its first-letter block gets an update in RenderTextFragment::styleDidChan ge. For RenderTextFragment(s),
1777 // we will safely bail out with the doesNotNeedLayout flag. We might want to broaden this condition 1775 // we will safely bail out with the doesNotNeedLayout flag. We might want to broaden this condition
1778 // in the future as we move renderer changes out of layout and into style ch anges. 1776 // in the future as we move renderer changes out of layout and into style ch anges.
1779 // FIXME(sky): Remove this. 1777 // FIXME(sky): Remove this.
1780 if (doesNotNeedLayout) 1778 if (doesNotNeedLayout)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 void RenderObject::updateImage(StyleImage* oldImage, StyleImage* newImage) 1927 void RenderObject::updateImage(StyleImage* oldImage, StyleImage* newImage)
1930 { 1928 {
1931 if (oldImage != newImage) { 1929 if (oldImage != newImage) {
1932 if (oldImage) 1930 if (oldImage)
1933 oldImage->removeClient(this); 1931 oldImage->removeClient(this);
1934 if (newImage) 1932 if (newImage)
1935 newImage->addClient(this); 1933 newImage->addClient(this);
1936 } 1934 }
1937 } 1935 }
1938 1936
1939 void RenderObject::updateShapeImage(const ShapeValue* oldShapeValue, const Shape Value* newShapeValue)
1940 {
1941 if (oldShapeValue || newShapeValue)
1942 updateImage(oldShapeValue ? oldShapeValue->image() : 0, newShapeValue ? newShapeValue->image() : 0);
1943 }
1944
1945 LayoutRect RenderObject::viewRect() const 1937 LayoutRect RenderObject::viewRect() const
1946 { 1938 {
1947 return view()->viewRect(); 1939 return view()->viewRect();
1948 } 1940 }
1949 1941
1950 FloatPoint RenderObject::localToAbsolute(const FloatPoint& localPoint, MapCoordi natesFlags mode) const 1942 FloatPoint RenderObject::localToAbsolute(const FloatPoint& localPoint, MapCoordi natesFlags mode) const
1951 { 1943 {
1952 TransformState transformState(TransformState::ApplyTransformDirection, local Point); 1944 TransformState transformState(TransformState::ApplyTransformDirection, local Point);
1953 mapLocalToContainer(0, transformState, mode | ApplyContainerFlip); 1945 mapLocalToContainer(0, transformState, mode | ApplyContainerFlip);
1954 transformState.flatten(); 1946 transformState.flatten();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 void RenderObject::destroy() 2348 void RenderObject::destroy()
2357 { 2349 {
2358 #if ENABLE(ASSERT) && ENABLE(OILPAN) 2350 #if ENABLE(ASSERT) && ENABLE(OILPAN)
2359 ASSERT(!m_didCallDestroy); 2351 ASSERT(!m_didCallDestroy);
2360 m_didCallDestroy = true; 2352 m_didCallDestroy = true;
2361 #endif 2353 #endif
2362 willBeDestroyed(); 2354 willBeDestroyed();
2363 postDestroy(); 2355 postDestroy();
2364 } 2356 }
2365 2357
2366 void RenderObject::removeShapeImageClient(ShapeValue* shapeValue)
2367 {
2368 if (!shapeValue)
2369 return;
2370 if (StyleImage* shapeImage = shapeValue->image())
2371 shapeImage->removeClient(this);
2372 }
2373
2374 void RenderObject::postDestroy() 2358 void RenderObject::postDestroy()
2375 { 2359 {
2376 // It seems ugly that this is not in willBeDestroyed(). 2360 // It seems ugly that this is not in willBeDestroyed().
2377 if (m_style) { 2361 if (m_style) {
2378 for (const FillLayer* bgLayer = &m_style->backgroundLayers(); bgLayer; b gLayer = bgLayer->next()) { 2362 for (const FillLayer* bgLayer = &m_style->backgroundLayers(); bgLayer; b gLayer = bgLayer->next()) {
2379 if (StyleImage* backgroundImage = bgLayer->image()) 2363 if (StyleImage* backgroundImage = bgLayer->image())
2380 backgroundImage->removeClient(this); 2364 backgroundImage->removeClient(this);
2381 } 2365 }
2382 2366
2383 for (const FillLayer* maskLayer = &m_style->maskLayers(); maskLayer; mas kLayer = maskLayer->next()) { 2367 for (const FillLayer* maskLayer = &m_style->maskLayers(); maskLayer; mas kLayer = maskLayer->next()) {
2384 if (StyleImage* maskImage = maskLayer->image()) 2368 if (StyleImage* maskImage = maskLayer->image())
2385 maskImage->removeClient(this); 2369 maskImage->removeClient(this);
2386 } 2370 }
2387 2371
2388 if (StyleImage* borderImage = m_style->borderImage().image()) 2372 if (StyleImage* borderImage = m_style->borderImage().image())
2389 borderImage->removeClient(this); 2373 borderImage->removeClient(this);
2390 2374
2391 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image()) 2375 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image())
2392 maskBoxImage->removeClient(this); 2376 maskBoxImage->removeClient(this);
2393
2394 removeShapeImageClient(m_style->shapeOutside());
2395 } 2377 }
2396 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRender Object(this); 2378 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRender Object(this);
2397 #if !ENABLE(OILPAN) 2379 #if !ENABLE(OILPAN)
2398 delete this; 2380 delete this;
2399 #endif 2381 #endif
2400 } 2382 }
2401 2383
2402 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) 2384 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&)
2403 { 2385 {
2404 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); 2386 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM);
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 { 2817 {
2836 if (object1) { 2818 if (object1) {
2837 const blink::RenderObject* root = object1; 2819 const blink::RenderObject* root = object1;
2838 while (root->parent()) 2820 while (root->parent())
2839 root = root->parent(); 2821 root = root->parent();
2840 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2822 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2841 } 2823 }
2842 } 2824 }
2843 2825
2844 #endif 2826 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/line/LineWidth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698