Parser.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. /*
  2. * Copyright (c) 2020-2021, the SerenityOS developers.
  3. * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/Error.h>
  9. #include <AK/RefPtr.h>
  10. #include <AK/Vector.h>
  11. #include <LibWeb/CSS/CSSStyleDeclaration.h>
  12. #include <LibWeb/CSS/FontFace.h>
  13. #include <LibWeb/CSS/GeneralEnclosed.h>
  14. #include <LibWeb/CSS/MediaQuery.h>
  15. #include <LibWeb/CSS/Parser/Block.h>
  16. #include <LibWeb/CSS/Parser/ComponentValue.h>
  17. #include <LibWeb/CSS/Parser/Declaration.h>
  18. #include <LibWeb/CSS/Parser/DeclarationOrAtRule.h>
  19. #include <LibWeb/CSS/Parser/Function.h>
  20. #include <LibWeb/CSS/Parser/Rule.h>
  21. #include <LibWeb/CSS/Parser/TokenStream.h>
  22. #include <LibWeb/CSS/Parser/Tokenizer.h>
  23. #include <LibWeb/CSS/Position.h>
  24. #include <LibWeb/CSS/PropertyID.h>
  25. #include <LibWeb/CSS/Ratio.h>
  26. #include <LibWeb/CSS/Selector.h>
  27. #include <LibWeb/CSS/StyleValue.h>
  28. #include <LibWeb/CSS/StyleValues/AbstractImageStyleValue.h>
  29. #include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
  30. #include <LibWeb/CSS/Supports.h>
  31. #include <LibWeb/CSS/UnicodeRange.h>
  32. #include <LibWeb/Forward.h>
  33. namespace Web::CSS::Parser {
  34. class ParsingContext {
  35. public:
  36. explicit ParsingContext(JS::Realm&);
  37. explicit ParsingContext(DOM::Document const&);
  38. explicit ParsingContext(DOM::Document const&, AK::URL);
  39. explicit ParsingContext(DOM::ParentNode&);
  40. bool in_quirks_mode() const;
  41. DOM::Document const* document() const { return m_document; }
  42. HTML::Window const* window() const;
  43. AK::URL complete_url(StringView) const;
  44. PropertyID current_property_id() const { return m_current_property_id; }
  45. void set_current_property_id(PropertyID property_id) { m_current_property_id = property_id; }
  46. JS::Realm& realm() const { return m_realm; }
  47. private:
  48. JS::NonnullGCPtr<JS::Realm> m_realm;
  49. JS::GCPtr<DOM::Document const> m_document;
  50. PropertyID m_current_property_id { PropertyID::Invalid };
  51. AK::URL m_url;
  52. };
  53. class Parser {
  54. public:
  55. static ErrorOr<Parser> create(ParsingContext const&, StringView input, StringView encoding = "utf-8"sv);
  56. Parser(Parser&&);
  57. CSSStyleSheet* parse_as_css_stylesheet(Optional<AK::URL> location);
  58. ElementInlineCSSStyleDeclaration* parse_as_style_attribute(DOM::Element&);
  59. CSSRule* parse_as_css_rule();
  60. Optional<StyleProperty> parse_as_supports_condition();
  61. enum class SelectorParsingMode {
  62. Standard,
  63. // `<forgiving-selector-list>` and `<forgiving-relative-selector-list>`
  64. // are handled with this parameter, not as separate functions.
  65. // https://drafts.csswg.org/selectors/#forgiving-selector
  66. Forgiving
  67. };
  68. // Contrary to the name, these parse a comma-separated list of selectors, according to the spec.
  69. Optional<SelectorList> parse_as_selector(SelectorParsingMode = SelectorParsingMode::Standard);
  70. Optional<SelectorList> parse_as_relative_selector(SelectorParsingMode = SelectorParsingMode::Standard);
  71. Vector<NonnullRefPtr<MediaQuery>> parse_as_media_query_list();
  72. RefPtr<MediaQuery> parse_as_media_query();
  73. RefPtr<Supports> parse_as_supports();
  74. ErrorOr<RefPtr<StyleValue>> parse_as_css_value(PropertyID);
  75. static ErrorOr<RefPtr<StyleValue>> parse_css_value(Badge<StyleComputer>, ParsingContext const&, PropertyID, Vector<ComponentValue> const&);
  76. static ErrorOr<RefPtr<CalculatedStyleValue>> parse_calculated_value(Badge<StyleComputer>, ParsingContext const&, Vector<ComponentValue> const&);
  77. [[nodiscard]] LengthOrCalculated parse_as_sizes_attribute();
  78. private:
  79. Parser(ParsingContext const&, Vector<Token>);
  80. enum class ParseError {
  81. IncludesIgnoredVendorPrefix,
  82. InternalError,
  83. SyntaxError,
  84. };
  85. template<typename T>
  86. using ParseErrorOr = ErrorOr<T, ParseError>;
  87. // "Parse a stylesheet" is intended to be the normal parser entry point, for parsing stylesheets.
  88. struct ParsedStyleSheet {
  89. Optional<AK::URL> location;
  90. Vector<NonnullRefPtr<Rule>> rules;
  91. };
  92. template<typename T>
  93. ParsedStyleSheet parse_a_stylesheet(TokenStream<T>&, Optional<AK::URL> location);
  94. // "Parse a list of rules" is intended for the content of at-rules such as @media. It differs from "Parse a stylesheet" in the handling of <CDO-token> and <CDC-token>.
  95. template<typename T>
  96. Vector<NonnullRefPtr<Rule>> parse_a_list_of_rules(TokenStream<T>&);
  97. // "Parse a rule" is intended for use by the CSSStyleSheet#insertRule method, and similar functions which might exist, which parse text into a single rule.
  98. template<typename T>
  99. RefPtr<Rule> parse_a_rule(TokenStream<T>&);
  100. // "Parse a declaration" is used in @supports conditions. [CSS3-CONDITIONAL]
  101. template<typename T>
  102. Optional<Declaration> parse_a_declaration(TokenStream<T>&);
  103. template<typename T>
  104. Vector<DeclarationOrAtRule> parse_a_style_blocks_contents(TokenStream<T>&);
  105. // "Parse a list of declarations" is for the contents of a style attribute, which parses text into the contents of a single style rule.
  106. template<typename T>
  107. Vector<DeclarationOrAtRule> parse_a_list_of_declarations(TokenStream<T>&);
  108. // "Parse a component value" is for things that need to consume a single value, like the parsing rules for attr().
  109. template<typename T>
  110. Optional<ComponentValue> parse_a_component_value(TokenStream<T>&);
  111. // "Parse a list of component values" is for the contents of presentational attributes, which parse text into a single declaration’s value, or for parsing a stand-alone selector [SELECT] or list of Media Queries [MEDIAQ], as in Selectors API or the media HTML attribute.
  112. template<typename T>
  113. Vector<ComponentValue> parse_a_list_of_component_values(TokenStream<T>&);
  114. template<typename T>
  115. Vector<Vector<ComponentValue>> parse_a_comma_separated_list_of_component_values(TokenStream<T>&);
  116. enum class SelectorType {
  117. Standalone,
  118. Relative
  119. };
  120. template<typename T>
  121. ParseErrorOr<SelectorList> parse_a_selector_list(TokenStream<T>&, SelectorType, SelectorParsingMode = SelectorParsingMode::Standard);
  122. template<typename T>
  123. Vector<NonnullRefPtr<MediaQuery>> parse_a_media_query_list(TokenStream<T>&);
  124. template<typename T>
  125. RefPtr<Supports> parse_a_supports(TokenStream<T>&);
  126. Optional<Selector::SimpleSelector::ANPlusBPattern> parse_a_n_plus_b_pattern(TokenStream<ComponentValue>&);
  127. enum class TopLevel {
  128. No,
  129. Yes
  130. };
  131. template<typename T>
  132. [[nodiscard]] Vector<NonnullRefPtr<Rule>> consume_a_list_of_rules(TokenStream<T>&, TopLevel);
  133. template<typename T>
  134. [[nodiscard]] NonnullRefPtr<Rule> consume_an_at_rule(TokenStream<T>&);
  135. template<typename T>
  136. RefPtr<Rule> consume_a_qualified_rule(TokenStream<T>&);
  137. template<typename T>
  138. [[nodiscard]] Vector<DeclarationOrAtRule> consume_a_style_blocks_contents(TokenStream<T>&);
  139. template<typename T>
  140. [[nodiscard]] Vector<DeclarationOrAtRule> consume_a_list_of_declarations(TokenStream<T>&);
  141. template<typename T>
  142. Optional<Declaration> consume_a_declaration(TokenStream<T>&);
  143. template<typename T>
  144. [[nodiscard]] ComponentValue consume_a_component_value(TokenStream<T>&);
  145. template<typename T>
  146. NonnullRefPtr<Block> consume_a_simple_block(TokenStream<T>&);
  147. template<typename T>
  148. NonnullRefPtr<Function> consume_a_function(TokenStream<T>&);
  149. Optional<GeneralEnclosed> parse_general_enclosed(TokenStream<ComponentValue>&);
  150. CSSRule* parse_font_face_rule(TokenStream<ComponentValue>&);
  151. Vector<FontFace::Source> parse_font_face_src(TokenStream<ComponentValue>&);
  152. CSSRule* convert_to_rule(NonnullRefPtr<Rule>);
  153. PropertyOwningCSSStyleDeclaration* convert_to_style_declaration(Vector<DeclarationOrAtRule> const& declarations);
  154. Optional<StyleProperty> convert_to_style_property(Declaration const&);
  155. class Dimension {
  156. public:
  157. Dimension(Angle&& value)
  158. : m_value(move(value))
  159. {
  160. }
  161. Dimension(Frequency&& value)
  162. : m_value(move(value))
  163. {
  164. }
  165. Dimension(Length&& value)
  166. : m_value(move(value))
  167. {
  168. }
  169. Dimension(Percentage&& value)
  170. : m_value(move(value))
  171. {
  172. }
  173. Dimension(Resolution&& value)
  174. : m_value(move(value))
  175. {
  176. }
  177. Dimension(Time&& value)
  178. : m_value(move(value))
  179. {
  180. }
  181. bool is_angle() const;
  182. Angle angle() const;
  183. bool is_angle_percentage() const;
  184. AnglePercentage angle_percentage() const;
  185. bool is_frequency() const;
  186. Frequency frequency() const;
  187. bool is_frequency_percentage() const;
  188. FrequencyPercentage frequency_percentage() const;
  189. bool is_length() const;
  190. Length length() const;
  191. bool is_length_percentage() const;
  192. LengthPercentage length_percentage() const;
  193. bool is_percentage() const;
  194. Percentage percentage() const;
  195. bool is_resolution() const;
  196. Resolution resolution() const;
  197. bool is_time() const;
  198. Time time() const;
  199. bool is_time_percentage() const;
  200. TimePercentage time_percentage() const;
  201. private:
  202. Variant<Angle, Frequency, Length, Percentage, Resolution, Time> m_value;
  203. };
  204. Optional<Dimension> parse_dimension(ComponentValue const&);
  205. Optional<Color> parse_rgb_or_hsl_color(StringView function_name, Vector<ComponentValue> const&);
  206. Optional<Color> parse_color(ComponentValue const&);
  207. Optional<Length> parse_length(ComponentValue const&);
  208. [[nodiscard]] Optional<LengthOrCalculated> parse_source_size_value(ComponentValue const&);
  209. Optional<Ratio> parse_ratio(TokenStream<ComponentValue>&);
  210. Optional<UnicodeRange> parse_unicode_range(TokenStream<ComponentValue>&);
  211. Optional<UnicodeRange> parse_unicode_range(StringView);
  212. Optional<GridSize> parse_grid_size(ComponentValue const&);
  213. Optional<GridMinMax> parse_min_max(Vector<ComponentValue> const&);
  214. Optional<GridRepeat> parse_repeat(Vector<ComponentValue> const&);
  215. Optional<ExplicitGridTrack> parse_track_sizing_function(ComponentValue const&);
  216. Optional<PositionValue> parse_position(TokenStream<ComponentValue>&, PositionValue initial_value = PositionValue::center());
  217. Optional<AK::URL> parse_url_function(ComponentValue const&);
  218. ErrorOr<RefPtr<StyleValue>> parse_url_value(ComponentValue const&);
  219. Optional<Vector<LinearColorStopListElement>> parse_linear_color_stop_list(TokenStream<ComponentValue>&);
  220. Optional<Vector<AngularColorStopListElement>> parse_angular_color_stop_list(TokenStream<ComponentValue>&);
  221. ErrorOr<RefPtr<StyleValue>> parse_linear_gradient_function(ComponentValue const&);
  222. ErrorOr<RefPtr<StyleValue>> parse_conic_gradient_function(ComponentValue const&);
  223. ErrorOr<RefPtr<StyleValue>> parse_radial_gradient_function(ComponentValue const&);
  224. ParseErrorOr<NonnullRefPtr<StyleValue>> parse_css_value(PropertyID, TokenStream<ComponentValue>&);
  225. ErrorOr<RefPtr<StyleValue>> parse_css_value_for_property(PropertyID, TokenStream<ComponentValue>&);
  226. struct PropertyAndValue {
  227. PropertyID property;
  228. RefPtr<StyleValue> style_value;
  229. };
  230. ErrorOr<PropertyAndValue> parse_css_value_for_properties(ReadonlySpan<PropertyID>, TokenStream<ComponentValue>&);
  231. ErrorOr<RefPtr<StyleValue>> parse_builtin_value(ComponentValue const&);
  232. ErrorOr<RefPtr<StyleValue>> parse_dynamic_value(ComponentValue const&);
  233. ErrorOr<RefPtr<CalculatedStyleValue>> parse_calculated_value(Vector<ComponentValue> const&);
  234. // NOTE: Implemented in generated code. (GenerateCSSMathFunctions.cpp)
  235. ErrorOr<OwnPtr<CalculationNode>> parse_math_function(PropertyID, Function const&);
  236. ErrorOr<OwnPtr<CalculationNode>> parse_a_calc_function_node(Function const&);
  237. ErrorOr<RefPtr<StyleValue>> parse_dimension_value(ComponentValue const&);
  238. ErrorOr<RefPtr<StyleValue>> parse_integer_value(TokenStream<ComponentValue>&);
  239. ErrorOr<RefPtr<StyleValue>> parse_number_value(TokenStream<ComponentValue>&);
  240. ErrorOr<RefPtr<StyleValue>> parse_identifier_value(ComponentValue const&);
  241. ErrorOr<RefPtr<StyleValue>> parse_color_value(ComponentValue const&);
  242. ErrorOr<RefPtr<StyleValue>> parse_rect_value(ComponentValue const&);
  243. ErrorOr<RefPtr<StyleValue>> parse_ratio_value(TokenStream<ComponentValue>&);
  244. ErrorOr<RefPtr<StyleValue>> parse_string_value(ComponentValue const&);
  245. ErrorOr<RefPtr<StyleValue>> parse_image_value(ComponentValue const&);
  246. ErrorOr<RefPtr<StyleValue>> parse_paint_value(TokenStream<ComponentValue>&);
  247. template<typename ParseFunction>
  248. ErrorOr<RefPtr<StyleValue>> parse_comma_separated_value_list(Vector<ComponentValue> const&, ParseFunction);
  249. ErrorOr<RefPtr<StyleValue>> parse_simple_comma_separated_value_list(PropertyID, Vector<ComponentValue> const&);
  250. ErrorOr<RefPtr<StyleValue>> parse_filter_value_list_value(Vector<ComponentValue> const&);
  251. ErrorOr<RefPtr<StyleValue>> parse_aspect_ratio_value(Vector<ComponentValue> const&);
  252. ErrorOr<RefPtr<StyleValue>> parse_background_value(Vector<ComponentValue> const&);
  253. ErrorOr<RefPtr<StyleValue>> parse_single_background_position_value(TokenStream<ComponentValue>&);
  254. ErrorOr<RefPtr<StyleValue>> parse_single_background_position_x_or_y_value(TokenStream<ComponentValue>&, PropertyID);
  255. ErrorOr<RefPtr<StyleValue>> parse_single_background_repeat_value(TokenStream<ComponentValue>&);
  256. ErrorOr<RefPtr<StyleValue>> parse_single_background_size_value(TokenStream<ComponentValue>&);
  257. ErrorOr<RefPtr<StyleValue>> parse_border_value(Vector<ComponentValue> const&);
  258. ErrorOr<RefPtr<StyleValue>> parse_border_radius_value(Vector<ComponentValue> const&);
  259. ErrorOr<RefPtr<StyleValue>> parse_border_radius_shorthand_value(Vector<ComponentValue> const&);
  260. ErrorOr<RefPtr<StyleValue>> parse_content_value(Vector<ComponentValue> const&);
  261. ErrorOr<RefPtr<StyleValue>> parse_display_value(Vector<ComponentValue> const&);
  262. ErrorOr<RefPtr<StyleValue>> parse_flex_value(Vector<ComponentValue> const&);
  263. ErrorOr<RefPtr<StyleValue>> parse_flex_flow_value(Vector<ComponentValue> const&);
  264. ErrorOr<RefPtr<StyleValue>> parse_font_value(Vector<ComponentValue> const&);
  265. ErrorOr<RefPtr<StyleValue>> parse_font_family_value(TokenStream<ComponentValue>&);
  266. ErrorOr<RefPtr<StyleValue>> parse_list_style_value(Vector<ComponentValue> const&);
  267. ErrorOr<RefPtr<StyleValue>> parse_overflow_value(Vector<ComponentValue> const&);
  268. ErrorOr<RefPtr<StyleValue>> parse_place_content_value(Vector<ComponentValue> const&);
  269. ErrorOr<RefPtr<StyleValue>> parse_place_items_value(Vector<ComponentValue> const&);
  270. ErrorOr<RefPtr<StyleValue>> parse_place_self_value(Vector<ComponentValue> const&);
  271. enum class AllowInsetKeyword {
  272. No,
  273. Yes,
  274. };
  275. ErrorOr<RefPtr<StyleValue>> parse_shadow_value(Vector<ComponentValue> const&, AllowInsetKeyword);
  276. ErrorOr<RefPtr<StyleValue>> parse_single_shadow_value(TokenStream<ComponentValue>&, AllowInsetKeyword);
  277. ErrorOr<RefPtr<StyleValue>> parse_text_decoration_value(Vector<ComponentValue> const&);
  278. ErrorOr<RefPtr<StyleValue>> parse_text_decoration_line_value(TokenStream<ComponentValue>&);
  279. ErrorOr<RefPtr<StyleValue>> parse_easing_value(TokenStream<ComponentValue>&);
  280. ErrorOr<RefPtr<StyleValue>> parse_transform_value(Vector<ComponentValue> const&);
  281. ErrorOr<RefPtr<StyleValue>> parse_transform_origin_value(Vector<ComponentValue> const&);
  282. ErrorOr<RefPtr<StyleValue>> parse_grid_track_size_list(Vector<ComponentValue> const&, bool allow_separate_line_name_blocks = false);
  283. ErrorOr<RefPtr<StyleValue>> parse_grid_auto_track_sizes(Vector<ComponentValue> const&);
  284. ErrorOr<RefPtr<StyleValue>> parse_grid_track_size_list_shorthand_value(Vector<ComponentValue> const&);
  285. ErrorOr<RefPtr<StyleValue>> parse_grid_track_placement(Vector<ComponentValue> const&);
  286. ErrorOr<RefPtr<StyleValue>> parse_grid_track_placement_shorthand_value(Vector<ComponentValue> const&);
  287. ErrorOr<RefPtr<StyleValue>> parse_grid_template_areas_value(Vector<ComponentValue> const&);
  288. ErrorOr<RefPtr<StyleValue>> parse_grid_area_shorthand_value(Vector<ComponentValue> const&);
  289. ErrorOr<RefPtr<StyleValue>> parse_grid_shorthand_value(Vector<ComponentValue> const&);
  290. ErrorOr<OwnPtr<CalculationNode>> parse_a_calculation(Vector<ComponentValue> const&);
  291. ParseErrorOr<NonnullRefPtr<Selector>> parse_complex_selector(TokenStream<ComponentValue>&, SelectorType);
  292. ParseErrorOr<Optional<Selector::CompoundSelector>> parse_compound_selector(TokenStream<ComponentValue>&);
  293. Optional<Selector::Combinator> parse_selector_combinator(TokenStream<ComponentValue>&);
  294. enum class AllowWildcardName {
  295. No,
  296. Yes,
  297. };
  298. Optional<Selector::SimpleSelector::QualifiedName> parse_selector_qualified_name(TokenStream<ComponentValue>&, AllowWildcardName);
  299. ParseErrorOr<Selector::SimpleSelector> parse_attribute_simple_selector(ComponentValue const&);
  300. ParseErrorOr<Selector::SimpleSelector> parse_pseudo_simple_selector(TokenStream<ComponentValue>&);
  301. ParseErrorOr<Optional<Selector::SimpleSelector>> parse_simple_selector(TokenStream<ComponentValue>&);
  302. NonnullRefPtr<MediaQuery> parse_media_query(TokenStream<ComponentValue>&);
  303. OwnPtr<MediaCondition> parse_media_condition(TokenStream<ComponentValue>&, MediaCondition::AllowOr allow_or);
  304. Optional<MediaFeature> parse_media_feature(TokenStream<ComponentValue>&);
  305. Optional<MediaQuery::MediaType> parse_media_type(TokenStream<ComponentValue>&);
  306. OwnPtr<MediaCondition> parse_media_in_parens(TokenStream<ComponentValue>&);
  307. Optional<MediaFeatureValue> parse_media_feature_value(MediaFeatureID, TokenStream<ComponentValue>&);
  308. OwnPtr<Supports::Condition> parse_supports_condition(TokenStream<ComponentValue>&);
  309. Optional<Supports::InParens> parse_supports_in_parens(TokenStream<ComponentValue>&);
  310. Optional<Supports::Feature> parse_supports_feature(TokenStream<ComponentValue>&);
  311. static bool has_ignored_vendor_prefix(StringView);
  312. static bool is_builtin(StringView);
  313. struct PropertiesAndCustomProperties {
  314. Vector<StyleProperty> properties;
  315. HashMap<DeprecatedString, StyleProperty> custom_properties;
  316. };
  317. PropertiesAndCustomProperties extract_properties(Vector<DeclarationOrAtRule> const&);
  318. ParsingContext m_context;
  319. Vector<Token> m_tokens;
  320. TokenStream<Token> m_token_stream;
  321. };
  322. }
  323. namespace Web {
  324. CSS::CSSStyleSheet* parse_css_stylesheet(CSS::Parser::ParsingContext const&, StringView, Optional<AK::URL> location = {});
  325. CSS::ElementInlineCSSStyleDeclaration* parse_css_style_attribute(CSS::Parser::ParsingContext const&, StringView, DOM::Element&);
  326. ErrorOr<RefPtr<CSS::StyleValue>> parse_css_value(CSS::Parser::ParsingContext const&, StringView, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
  327. Optional<CSS::SelectorList> parse_selector(CSS::Parser::ParsingContext const&, StringView);
  328. CSS::CSSRule* parse_css_rule(CSS::Parser::ParsingContext const&, StringView);
  329. RefPtr<CSS::MediaQuery> parse_media_query(CSS::Parser::ParsingContext const&, StringView);
  330. Vector<NonnullRefPtr<CSS::MediaQuery>> parse_media_query_list(CSS::Parser::ParsingContext const&, StringView);
  331. RefPtr<CSS::Supports> parse_css_supports(CSS::Parser::ParsingContext const&, StringView);
  332. Optional<CSS::StyleProperty> parse_css_supports_condition(CSS::Parser::ParsingContext const&, StringView);
  333. }