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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Send over for review Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // Any properties that are inherited on a style are also inherited on elemen ts 383 // Any properties that are inherited on a style are also inherited on elemen ts
384 // that share this style. 384 // that share this style.
385 m_nonInheritedData.m_isPointerEventsInherited = other.m_nonInheritedData.m_i sPointerEventsInherited; 385 m_nonInheritedData.m_isPointerEventsInherited = other.m_nonInheritedData.m_i sPointerEventsInherited;
386 m_nonInheritedData.m_isVisibilityInherited = other.m_nonInheritedData.m_isVi sibilityInherited; 386 m_nonInheritedData.m_isVisibilityInherited = other.m_nonInheritedData.m_isVi sibilityInherited;
387 387
388 if (m_svgStyle != other.m_svgStyle) 388 if (m_svgStyle != other.m_svgStyle)
389 m_svgStyle.access()->copyNonInheritedFromCached(other.m_svgStyle.get()); 389 m_svgStyle.access()->copyNonInheritedFromCached(other.m_svgStyle.get());
390 DCHECK_EQ(zoom(), initialZoom()); 390 DCHECK_EQ(zoom(), initialZoom());
391 } 391 }
392 392
393 bool ComputedStyle::hasImage()
394 {
395 return backgroundLayers().image() || maskLayers().image()
396 || borderImage().image() || maskBoxImage().image()
397 || (contentData() && contentData()->isImage())
398 || (boxReflect() && boxReflect()->mask().image())
399 || (shapeOutside() && shapeOutside()->image())
400 || cursors() || borderImageSource()
401 || hasFixedBackgroundImage() || hasBackgroundImage()
402 || listStyleImage() || maskImage();
403 }
404
405
393 bool ComputedStyle::operator==(const ComputedStyle& o) const 406 bool ComputedStyle::operator==(const ComputedStyle& o) const
394 { 407 {
395 return inheritedEqual(o) 408 return inheritedEqual(o)
396 && nonInheritedEqual(o); 409 && nonInheritedEqual(o);
397 } 410 }
398 411
399 bool ComputedStyle::isStyleAvailable() const 412 bool ComputedStyle::isStyleAvailable() const
400 { 413 {
401 return this != StyleResolver::styleNotYetAvailable(); 414 return this != StyleResolver::styleNotYetAvailable();
402 } 415 }
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2041 if (value < 0) 2054 if (value < 0)
2042 fvalue -= 0.5f; 2055 fvalue -= 0.5f;
2043 else 2056 else
2044 fvalue += 0.5f; 2057 fvalue += 0.5f;
2045 } 2058 }
2046 2059
2047 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2060 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2048 } 2061 }
2049 2062
2050 } // namespace blink 2063 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698