libwordring
tree_structural_pseudo_classes.hpp
1 #pragma once
2 
3 // ------------------------------------------------------------------------------------------------
4 // 13. Tree-Structural pseudo-classes
5 //
6 // https://drafts.csswg.org/selectors-4/#structural-pseudos
7 // https://triple-underscore.github.io/selectors4-ja.html#structural-pseudos
8 // ------------------------------------------------------------------------------------------------
9 
10 #include <wordring/wwwc/selectors/pseudo_class_defs.hpp>
11 #include <wordring/wwwc/css_defs.hpp>
12 
13 #include <wordring/html/html_defs.hpp>
14 
15 namespace wordring::wwwc::css
16 {
17  // --------------------------------------------------------------------------------------------
18  // 13.1. :root pseudo-class
19  //
20  // https://drafts.csswg.org/selectors-4/#the-root-pseudo
21  // https://triple-underscore.github.io/selectors4-ja.html#the-empty-pseudo
22  // --------------------------------------------------------------------------------------------
23 
25  {
26  using document_type_name = wordring::html::document_type_name;
28 
29  public:
30  template <typename NodePointer>
31  static bool match(NodePointer const& np, match_context<NodePointer> const& ctx)
32  {
33  using traits = typename wordring::html::node_traits<NodePointer>;
34  return traits::is_root(np);
35  }
36  };
37 }
wordring::wwwc::css::root_pseudo_class
Definition: tree_structural_pseudo_classes.hpp:24
wordring::html::node_traits
HTMLノードへの操作を仲介するアダプタ
Definition: html/html_defs.hpp:29
wordring::wwwc::css
wordring::wwwc::css::match_context
CSS セレクタとノードの照合に使われるコンテキスト
Definition: css_defs.hpp:33
wordring::whatwg::html::document_mode_name
document_mode_name
Definition: whatwg/html/html_defs.hpp:28