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

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

Issue 2563753003: Moved pointer-events to be generated in ComputedStyleBase (Closed)
Patch Set: Rebase Created 4 years 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 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 if (oldStyle->hasExplicitlyInheritedProperties()) 229 if (oldStyle->hasExplicitlyInheritedProperties())
230 return Inherit; 230 return Inherit;
231 231
232 return NoInherit; 232 return NoInherit;
233 } 233 }
234 234
235 void ComputedStyle::propagateIndependentInheritedProperties( 235 void ComputedStyle::propagateIndependentInheritedProperties(
236 const ComputedStyle& parentStyle) { 236 const ComputedStyle& parentStyle) {
237 ComputedStyleBase::propagateIndependentInheritedProperties(parentStyle); 237 ComputedStyleBase::propagateIndependentInheritedProperties(parentStyle);
238 if (m_nonInheritedData.m_isPointerEventsInherited)
239 setPointerEvents(parentStyle.pointerEvents());
240 } 238 }
241 239
242 StyleSelfAlignmentData resolvedSelfAlignment( 240 StyleSelfAlignmentData resolvedSelfAlignment(
243 const StyleSelfAlignmentData& value, 241 const StyleSelfAlignmentData& value,
244 ItemPosition normalValueBehavior) { 242 ItemPosition normalValueBehavior) {
245 // To avoid needing to copy the RareNonInheritedData, we repurpose the 'auto' 243 // To avoid needing to copy the RareNonInheritedData, we repurpose the 'auto'
246 // flag to not just mean 'auto' prior to running the StyleAdjuster but also 244 // flag to not just mean 'auto' prior to running the StyleAdjuster but also
247 // mean 'normal' after running it. 245 // mean 'normal' after running it.
248 if (value.position() == ItemPositionNormal || 246 if (value.position() == ItemPositionNormal ||
249 value.position() == ItemPositionAuto) 247 value.position() == ItemPositionAuto)
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // properties here, but the affectedBy flags will be set differently based on 409 // properties here, but the affectedBy flags will be set differently based on
412 // the matching order of the :-webkit-any components. 410 // the matching order of the :-webkit-any components.
413 // 411 //
414 // m_nonInheritedData.m_emptyState 412 // m_nonInheritedData.m_emptyState
415 // m_nonInheritedData.m_affectedByFocus 413 // m_nonInheritedData.m_affectedByFocus
416 // m_nonInheritedData.m_affectedByHover 414 // m_nonInheritedData.m_affectedByHover
417 // m_nonInheritedData.m_affectedByActive 415 // m_nonInheritedData.m_affectedByActive
418 // m_nonInheritedData.m_affectedByDrag 416 // m_nonInheritedData.m_affectedByDrag
419 // m_nonInheritedData.m_isLink 417 // m_nonInheritedData.m_isLink
420 418
421 // Any properties that are inherited on a style are also inherited on elements
422 // that share this style.
423 m_nonInheritedData.m_isPointerEventsInherited =
424 other.m_nonInheritedData.m_isPointerEventsInherited;
425
426 if (m_svgStyle != other.m_svgStyle) 419 if (m_svgStyle != other.m_svgStyle)
427 m_svgStyle.access()->copyNonInheritedFromCached(other.m_svgStyle.get()); 420 m_svgStyle.access()->copyNonInheritedFromCached(other.m_svgStyle.get());
428 DCHECK_EQ(zoom(), initialZoom()); 421 DCHECK_EQ(zoom(), initialZoom());
429 } 422 }
430 423
431 bool ComputedStyle::operator==(const ComputedStyle& o) const { 424 bool ComputedStyle::operator==(const ComputedStyle& o) const {
432 return inheritedEqual(o) && nonInheritedEqual(o); 425 return inheritedEqual(o) && nonInheritedEqual(o);
433 } 426 }
434 427
435 bool ComputedStyle::isStyleAvailable() const { 428 bool ComputedStyle::isStyleAvailable() const {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 487 }
495 } 488 }
496 489
497 bool ComputedStyle::inheritedEqual(const ComputedStyle& other) const { 490 bool ComputedStyle::inheritedEqual(const ComputedStyle& other) const {
498 return independentInheritedEqual(other) && 491 return independentInheritedEqual(other) &&
499 nonIndependentInheritedEqual(other); 492 nonIndependentInheritedEqual(other);
500 } 493 }
501 494
502 bool ComputedStyle::independentInheritedEqual( 495 bool ComputedStyle::independentInheritedEqual(
503 const ComputedStyle& other) const { 496 const ComputedStyle& other) const {
504 return ComputedStyleBase::independentInheritedEqual(other) && 497 return ComputedStyleBase::independentInheritedEqual(other);
505 m_inheritedData.compareEqualIndependent(other.m_inheritedData);
506 } 498 }
507 499
508 bool ComputedStyle::nonIndependentInheritedEqual( 500 bool ComputedStyle::nonIndependentInheritedEqual(
509 const ComputedStyle& other) const { 501 const ComputedStyle& other) const {
510 return ComputedStyleBase::nonIndependentInheritedEqual(other) && 502 return ComputedStyleBase::nonIndependentInheritedEqual(other) &&
511 m_inheritedData.compareEqualNonIndependent(other.m_inheritedData) && 503 m_inheritedData == other.m_inheritedData &&
512 m_styleInheritedData == other.m_styleInheritedData && 504 m_styleInheritedData == other.m_styleInheritedData &&
513 m_svgStyle->inheritedEqual(*other.m_svgStyle) && 505 m_svgStyle->inheritedEqual(*other.m_svgStyle) &&
514 m_rareInheritedData == other.m_rareInheritedData; 506 m_rareInheritedData == other.m_rareInheritedData;
515 } 507 }
516 508
517 bool ComputedStyle::loadingCustomFontsEqual(const ComputedStyle& other) const { 509 bool ComputedStyle::loadingCustomFontsEqual(const ComputedStyle& other) const {
518 return font().loadingCustomFonts() == other.font().loadingCustomFonts(); 510 return font().loadingCustomFonts() == other.font().loadingCustomFonts();
519 } 511 }
520 512
521 bool ComputedStyle::nonInheritedEqual(const ComputedStyle& other) const { 513 bool ComputedStyle::nonInheritedEqual(const ComputedStyle& other) const {
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 if (value < 0) 2474 if (value < 0)
2483 fvalue -= 0.5f; 2475 fvalue -= 0.5f;
2484 else 2476 else
2485 fvalue += 0.5f; 2477 fvalue += 0.5f;
2486 } 2478 }
2487 2479
2488 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2480 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2489 } 2481 }
2490 2482
2491 } // namespace blink 2483 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698