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

Unified Diff: Source/core/css/SelectorChecker.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/accessibility/AccessibilityObject.cpp ('k') | Source/core/css/resolver/ElementResolveContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index d9cfdf9d55ded72b5d351ce0a58ee1c0785f4b69..c4f4d7a468ef9bc2ab151b844a694025ad8b71d6 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -153,10 +153,8 @@ SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& con
return SelectorFailsLocally;
PseudoId pseudoId = CSSSelector::pseudoId(context.selector->pseudoType());
- if (pseudoId == FIRST_LETTER) {
- if (Document* document = context.element->document())
- document->styleSheetCollections()->setUsesFirstLetterRules(true);
- }
+ if (pseudoId == FIRST_LETTER)
+ context.element->document()->styleSheetCollections()->setUsesFirstLetterRules(true);
if (pseudoId != NOPSEUDO && m_mode != SharingRules)
dynamicPseudo = pseudoId;
}
@@ -675,7 +673,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
return !element->isDisabledFormControl();
break;
case CSSSelector::PseudoFullPageMedia:
- return element && element->document() && element->document()->isMediaDocument();
+ return element && element->document()->isMediaDocument();
break;
case CSSSelector::PseudoDefault:
return element && element->isDefaultButtonForForm();
« no previous file with comments | « Source/core/accessibility/AccessibilityObject.cpp ('k') | Source/core/css/resolver/ElementResolveContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698