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

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

Issue 2829773003: Make ComputedStyle::InheritFrom group independent. (Closed)
Patch Set: Rebase Created 3 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 | « no previous file | no next file » | 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 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 306
307 ContentDistributionType ComputedStyle::ResolvedAlignContentDistribution( 307 ContentDistributionType ComputedStyle::ResolvedAlignContentDistribution(
308 const StyleContentAlignmentData& normal_value_behavior) const { 308 const StyleContentAlignmentData& normal_value_behavior) const {
309 return ResolvedContentAlignmentDistribution(AlignContent(), 309 return ResolvedContentAlignmentDistribution(AlignContent(),
310 normal_value_behavior); 310 normal_value_behavior);
311 } 311 }
312 312
313 void ComputedStyle::InheritFrom(const ComputedStyle& inherit_parent, 313 void ComputedStyle::InheritFrom(const ComputedStyle& inherit_parent,
314 IsAtShadowBoundary is_at_shadow_boundary) { 314 IsAtShadowBoundary is_at_shadow_boundary) {
315 EUserModify current_user_modify = UserModify();
316
315 ComputedStyleBase::InheritFrom(inherit_parent, is_at_shadow_boundary); 317 ComputedStyleBase::InheritFrom(inherit_parent, is_at_shadow_boundary);
alancutter (OOO until 2018) 2017/05/09 00:09:18 Unrelated to this patch: Why does this function ta
shend 2017/05/09 00:16:02 I think ComputedStyleBase::InheritFrom was created
318 rare_inherited_data_ = inherit_parent.rare_inherited_data_;
319 inherited_data_ = inherit_parent.inherited_data_;
320 if (svg_style_ != inherit_parent.svg_style_)
321 svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get());
322
316 if (is_at_shadow_boundary == kAtShadowBoundary) { 323 if (is_at_shadow_boundary == kAtShadowBoundary) {
317 // Even if surrounding content is user-editable, shadow DOM should act as a 324 // Even if surrounding content is user-editable, shadow DOM should act as a
318 // single unit, and not necessarily be editable 325 // single unit, and not necessarily be editable
319 EUserModify current_user_modify = UserModify();
320 rare_inherited_data_ = inherit_parent.rare_inherited_data_;
321 SetUserModify(current_user_modify); 326 SetUserModify(current_user_modify);
322 } else {
323 rare_inherited_data_ = inherit_parent.rare_inherited_data_;
324 } 327 }
325 inherited_data_ = inherit_parent.inherited_data_;
326 if (svg_style_ != inherit_parent.svg_style_)
327 svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get());
328 } 328 }
329 329
330 void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) { 330 void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
331 ComputedStyleBase::CopyNonInheritedFromCached(other); 331 ComputedStyleBase::CopyNonInheritedFromCached(other);
332 box_data_ = other.box_data_; 332 box_data_ = other.box_data_;
333 visual_data_ = other.visual_data_; 333 visual_data_ = other.visual_data_;
334 rare_non_inherited_data_ = other.rare_non_inherited_data_; 334 rare_non_inherited_data_ = other.rare_non_inherited_data_;
335 335
336 // The flags are copied one-by-one because they contain 336 // The flags are copied one-by-one because they contain
337 // bunch of stuff other than real style data. 337 // bunch of stuff other than real style data.
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 if (value < 0) 2506 if (value < 0)
2507 fvalue -= 0.5f; 2507 fvalue -= 0.5f;
2508 else 2508 else
2509 fvalue += 0.5f; 2509 fvalue += 0.5f;
2510 } 2510 }
2511 2511
2512 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2512 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2513 } 2513 }
2514 2514
2515 } // namespace blink 2515 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698