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

Issue 322803004: Make all CSSSelector data members private (Closed)

Created:
6 years, 6 months ago by Inactive
Modified:
6 years, 6 months ago
Reviewers:
esprehn
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, eae+blinkwatch, ed+blinkwatch_opera.com, rwlbuis, rune+blink, sof
Visibility:
Public.

Description

Make all CSSSelector data members private Make all CSSSelector data members private. Previously, some of the data members such as m_relation / m_match / m_pseudoType were public and accessed directly from outside the class. The new approach is better because: - Those members are bit fields so by using getters, we can hide the casts inside the getters. The setters can now also check that the bitfield is big enough to actually store the enum value. - When using those in switch() statements, the compiler now complains if we fail to test some of the enum values as the value is now an enum, and not merely an unsigned integer. - Some of these members already has getters (e.g. relation(), pseudoType()). - Better encapsulation. R=esprehn@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175994

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Fix win dbg build error #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -45 lines) Patch
M Source/core/css/CSSParserValues.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/CSSParserValues.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/css/CSSSelector.h View 1 2 2 chunks +13 lines, -2 lines 1 comment Download
M Source/core/css/CSSSelector.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/css/CSSSelectorList.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/PageRuleCollector.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/RuleFeature.cpp View 5 chunks +12 lines, -12 lines 0 comments Download
M Source/core/css/RuleSet.cpp View 5 chunks +6 lines, -4 lines 0 comments Download
M Source/core/css/SelectorChecker.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/SelectorChecker.cpp View 1 5 chunks +9 lines, -9 lines 0 comments Download
M Source/core/css/SelectorFilter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/dom/SelectorQuery.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/HTMLContentElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
Inactive
6 years, 6 months ago (2014-06-09 22:11:02 UTC) #1
esprehn
lgtm https://codereview.chromium.org/322803004/diff/40001/Source/core/css/CSSSelector.h File Source/core/css/CSSSelector.h (right): https://codereview.chromium.org/322803004/diff/40001/Source/core/css/CSSSelector.h#newcode298 Source/core/css/CSSSelector.h:298: ASSERT(static_cast<Relation>(m_relation) == relation); // using a bitfield. <3, ...
6 years, 6 months ago (2014-06-12 00:52:19 UTC) #2
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 6 months ago (2014-06-12 02:10:42 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/322803004/40001
6 years, 6 months ago (2014-06-12 02:13:54 UTC) #4
commit-bot: I haz the power
6 years, 6 months ago (2014-06-12 05:59:37 UTC) #5
Message was sent while issue was closed.
Change committed as 175994

Powered by Google App Engine
This is Rietveld 408576698