├── .gitignore ├── CMakeLists.txt ├── COPYING.LESSER ├── Doxyfile ├── README.md ├── cmake ├── FindGLIB.cmake └── FindPurC.cmake ├── code-tools ├── css_property_parser_gen.c ├── gen_prop_parser.sh ├── gen_prop_select.sh ├── prop.gen └── select │ ├── assets.py │ ├── overrides.py │ ├── select_config.py │ └── select_generator.py └── src ├── CMakeLists.txt ├── layout ├── CMakeLists.txt ├── domruler.pc.in ├── include │ └── domruler.h └── src │ ├── css_select.c │ ├── domruler.c │ ├── hl_dom_element_node.c │ ├── hl_dom_element_node.h │ ├── hl_pcdom_element_t.c │ ├── hl_pcdom_element_t.h │ ├── internal.h │ ├── layout.c │ ├── layout.h │ ├── layout_grid.c │ ├── node.c │ ├── node.h │ ├── select.c │ ├── select.h │ ├── utils.c │ └── utils.h ├── samples ├── CMakeLists.txt └── layout_html │ ├── CMakeLists.txt │ ├── html.css │ ├── layout_html.c │ ├── window.css │ └── window.html ├── test ├── CMakeLists.txt ├── block_and_page_inline_block.css ├── block_inline_block.css ├── css_select.c ├── css_select2.c ├── display.css ├── fixed.css ├── fixed2.txt ├── fixed3.txt ├── grid.css ├── layout_1.css ├── layout_2.css ├── layout_pcdom_element.c ├── layout_test.c └── node_test.c ├── third-party ├── CMakeLists.txt ├── libcss │ ├── CMakeLists.txt │ ├── COPYING │ ├── Makefile.config │ ├── Makefile.orig │ ├── README │ ├── docs │ │ ├── API │ │ ├── API-ABI-Changes │ │ ├── Bytecode │ │ ├── Colour │ │ ├── Doxyfile │ │ ├── Grammar │ │ ├── Lexer │ │ ├── Representation │ │ └── Tokens │ ├── examples │ │ ├── CMakeLists.txt │ │ └── example1.c │ ├── hicss.pc.in │ ├── include │ │ └── libcss │ │ │ ├── computed.h │ │ │ ├── errors.h │ │ │ ├── font_face.h │ │ │ ├── fpmath.h │ │ │ ├── functypes.h │ │ │ ├── hint.h │ │ │ ├── libcss.h │ │ │ ├── properties.h │ │ │ ├── select.h │ │ │ ├── stylesheet.h │ │ │ └── types.h │ ├── libcss.pc.in │ ├── src │ │ ├── bytecode │ │ │ ├── bytecode.h │ │ │ └── opcodes.h │ │ ├── charset │ │ │ ├── detect.c │ │ │ └── detect.h │ │ ├── lex │ │ │ ├── lex.c │ │ │ └── lex.h │ │ ├── parse │ │ │ ├── font_face.c │ │ │ ├── font_face.h │ │ │ ├── important.c │ │ │ ├── important.h │ │ │ ├── language.c │ │ │ ├── language.h │ │ │ ├── mq.c │ │ │ ├── mq.h │ │ │ ├── parse.c │ │ │ ├── parse.h │ │ │ ├── properties │ │ │ │ ├── autogenerated_align_content.c │ │ │ │ ├── autogenerated_align_items.c │ │ │ │ ├── autogenerated_align_self.c │ │ │ │ ├── autogenerated_background_attachment.c │ │ │ │ ├── autogenerated_background_color.c │ │ │ │ ├── autogenerated_background_image.c │ │ │ │ ├── autogenerated_background_repeat.c │ │ │ │ ├── autogenerated_baseline_shift.c │ │ │ │ ├── autogenerated_border_bottom.c │ │ │ │ ├── autogenerated_border_bottom_color.c │ │ │ │ ├── autogenerated_border_bottom_left_radius.c │ │ │ │ ├── autogenerated_border_bottom_right_radius.c │ │ │ │ ├── autogenerated_border_bottom_style.c │ │ │ │ ├── autogenerated_border_bottom_width.c │ │ │ │ ├── autogenerated_border_collapse.c │ │ │ │ ├── autogenerated_border_left.c │ │ │ │ ├── autogenerated_border_left_color.c │ │ │ │ ├── autogenerated_border_left_style.c │ │ │ │ ├── autogenerated_border_left_width.c │ │ │ │ ├── autogenerated_border_right.c │ │ │ │ ├── autogenerated_border_right_color.c │ │ │ │ ├── autogenerated_border_right_style.c │ │ │ │ ├── autogenerated_border_right_width.c │ │ │ │ ├── autogenerated_border_side_color.c │ │ │ │ ├── autogenerated_border_side_style.c │ │ │ │ ├── autogenerated_border_side_width.c │ │ │ │ ├── autogenerated_border_top.c │ │ │ │ ├── autogenerated_border_top_color.c │ │ │ │ ├── autogenerated_border_top_left_radius.c │ │ │ │ ├── autogenerated_border_top_right_radius.c │ │ │ │ ├── autogenerated_border_top_style.c │ │ │ │ ├── autogenerated_border_top_width.c │ │ │ │ ├── autogenerated_bottom.c │ │ │ │ ├── autogenerated_box_sizing.c │ │ │ │ ├── autogenerated_break_after.c │ │ │ │ ├── autogenerated_break_before.c │ │ │ │ ├── autogenerated_break_inside.c │ │ │ │ ├── autogenerated_caption_side.c │ │ │ │ ├── autogenerated_clear.c │ │ │ │ ├── autogenerated_clip_path.c │ │ │ │ ├── autogenerated_clip_rule.c │ │ │ │ ├── autogenerated_color.c │ │ │ │ ├── autogenerated_column_count.c │ │ │ │ ├── autogenerated_column_fill.c │ │ │ │ ├── autogenerated_column_gap.c │ │ │ │ ├── autogenerated_column_rule_color.c │ │ │ │ ├── autogenerated_column_rule_style.c │ │ │ │ ├── autogenerated_column_rule_width.c │ │ │ │ ├── autogenerated_column_span.c │ │ │ │ ├── autogenerated_column_width.c │ │ │ │ ├── autogenerated_comp_op.c │ │ │ │ ├── autogenerated_counter_increment.c │ │ │ │ ├── autogenerated_counter_reset.c │ │ │ │ ├── autogenerated_cue_after.c │ │ │ │ ├── autogenerated_cue_before.c │ │ │ │ ├── autogenerated_direction.c │ │ │ │ ├── autogenerated_display.c │ │ │ │ ├── autogenerated_empty_cells.c │ │ │ │ ├── autogenerated_enable_background.c │ │ │ │ ├── autogenerated_fill.c │ │ │ │ ├── autogenerated_fill_opacity.c │ │ │ │ ├── autogenerated_fill_rule.c │ │ │ │ ├── autogenerated_filter.c │ │ │ │ ├── autogenerated_flex_basis.c │ │ │ │ ├── autogenerated_flex_direction.c │ │ │ │ ├── autogenerated_flex_grow.c │ │ │ │ ├── autogenerated_flex_shrink.c │ │ │ │ ├── autogenerated_flex_wrap.c │ │ │ │ ├── autogenerated_float.c │ │ │ │ ├── autogenerated_flood_color.c │ │ │ │ ├── autogenerated_flood_opacity.c │ │ │ │ ├── autogenerated_font_size.c │ │ │ │ ├── autogenerated_font_stretch.c │ │ │ │ ├── autogenerated_font_style.c │ │ │ │ ├── autogenerated_font_variant.c │ │ │ │ ├── autogenerated_grid_column_end.c │ │ │ │ ├── autogenerated_grid_column_start.c │ │ │ │ ├── autogenerated_grid_row_end.c │ │ │ │ ├── autogenerated_grid_row_start.c │ │ │ │ ├── autogenerated_grid_template_columns.c │ │ │ │ ├── autogenerated_grid_template_rows.c │ │ │ │ ├── autogenerated_height.c │ │ │ │ ├── autogenerated_justify_content.c │ │ │ │ ├── autogenerated_left.c │ │ │ │ ├── autogenerated_letter_spacing.c │ │ │ │ ├── autogenerated_line_height.c │ │ │ │ ├── autogenerated_list_style_image.c │ │ │ │ ├── autogenerated_list_style_position.c │ │ │ │ ├── autogenerated_margin_bottom.c │ │ │ │ ├── autogenerated_margin_left.c │ │ │ │ ├── autogenerated_margin_right.c │ │ │ │ ├── autogenerated_margin_side.c │ │ │ │ ├── autogenerated_margin_top.c │ │ │ │ ├── autogenerated_marker_end.c │ │ │ │ ├── autogenerated_marker_mid.c │ │ │ │ ├── autogenerated_marker_start.c │ │ │ │ ├── autogenerated_mask.c │ │ │ │ ├── autogenerated_max_height.c │ │ │ │ ├── autogenerated_max_width.c │ │ │ │ ├── autogenerated_min_height.c │ │ │ │ ├── autogenerated_min_width.c │ │ │ │ ├── autogenerated_order.c │ │ │ │ ├── autogenerated_orphans.c │ │ │ │ ├── autogenerated_outline_color.c │ │ │ │ ├── autogenerated_outline_style.c │ │ │ │ ├── autogenerated_outline_width.c │ │ │ │ ├── autogenerated_overflow_x.c │ │ │ │ ├── autogenerated_overflow_y.c │ │ │ │ ├── autogenerated_padding_bottom.c │ │ │ │ ├── autogenerated_padding_left.c │ │ │ │ ├── autogenerated_padding_right.c │ │ │ │ ├── autogenerated_padding_side.c │ │ │ │ ├── autogenerated_padding_top.c │ │ │ │ ├── autogenerated_page_break_after.c │ │ │ │ ├── autogenerated_page_break_before.c │ │ │ │ ├── autogenerated_page_break_inside.c │ │ │ │ ├── autogenerated_pause_after.c │ │ │ │ ├── autogenerated_pause_before.c │ │ │ │ ├── autogenerated_pitch.c │ │ │ │ ├── autogenerated_pitch_range.c │ │ │ │ ├── autogenerated_position.c │ │ │ │ ├── autogenerated_richness.c │ │ │ │ ├── autogenerated_right.c │ │ │ │ ├── autogenerated_shape_rendering.c │ │ │ │ ├── autogenerated_side.c │ │ │ │ ├── autogenerated_speak.c │ │ │ │ ├── autogenerated_speak_header.c │ │ │ │ ├── autogenerated_speak_numeral.c │ │ │ │ ├── autogenerated_speak_punctuation.c │ │ │ │ ├── autogenerated_speech_rate.c │ │ │ │ ├── autogenerated_stop_color.c │ │ │ │ ├── autogenerated_stop_opacity.c │ │ │ │ ├── autogenerated_stress.c │ │ │ │ ├── autogenerated_stroke.c │ │ │ │ ├── autogenerated_stroke_dasharray.c │ │ │ │ ├── autogenerated_stroke_dashoffset.c │ │ │ │ ├── autogenerated_stroke_linecap.c │ │ │ │ ├── autogenerated_stroke_linejoin.c │ │ │ │ ├── autogenerated_stroke_miterlimit.c │ │ │ │ ├── autogenerated_stroke_opacity.c │ │ │ │ ├── autogenerated_stroke_width.c │ │ │ │ ├── autogenerated_table_layout.c │ │ │ │ ├── autogenerated_text_align.c │ │ │ │ ├── autogenerated_text_align_last.c │ │ │ │ ├── autogenerated_text_anchor.c │ │ │ │ ├── autogenerated_text_indent.c │ │ │ │ ├── autogenerated_text_justify.c │ │ │ │ ├── autogenerated_text_overflow.c │ │ │ │ ├── autogenerated_text_rendering.c │ │ │ │ ├── autogenerated_text_shadow.c │ │ │ │ ├── autogenerated_text_transform.c │ │ │ │ ├── autogenerated_top.c │ │ │ │ ├── autogenerated_unicode_bidi.c │ │ │ │ ├── autogenerated_vertical_align.c │ │ │ │ ├── autogenerated_visibility.c │ │ │ │ ├── autogenerated_volume.c │ │ │ │ ├── autogenerated_white_space.c │ │ │ │ ├── autogenerated_widows.c │ │ │ │ ├── autogenerated_width.c │ │ │ │ ├── autogenerated_word_break.c │ │ │ │ ├── autogenerated_word_spacing.c │ │ │ │ ├── autogenerated_word_wrap.c │ │ │ │ ├── autogenerated_writing_mode.c │ │ │ │ ├── autogenerated_z_index.c │ │ │ │ ├── azimuth.c │ │ │ │ ├── background.c │ │ │ │ ├── background_position.c │ │ │ │ ├── border.c │ │ │ │ ├── border_color.c │ │ │ │ ├── border_spacing.c │ │ │ │ ├── border_style.c │ │ │ │ ├── border_width.c │ │ │ │ ├── clip.c │ │ │ │ ├── column_rule.c │ │ │ │ ├── columns.c │ │ │ │ ├── content.c │ │ │ │ ├── css_property_parser_gen.c │ │ │ │ ├── cue.c │ │ │ │ ├── cursor.c │ │ │ │ ├── elevation.c │ │ │ │ ├── fill.c │ │ │ │ ├── fill_opacity.c │ │ │ │ ├── filter.c │ │ │ │ ├── flex.c │ │ │ │ ├── flex_flow.c │ │ │ │ ├── flood_opacity.c │ │ │ │ ├── font.c │ │ │ │ ├── font_family.c │ │ │ │ ├── font_weight.c │ │ │ │ ├── grid_column_end.c │ │ │ │ ├── grid_column_start.c │ │ │ │ ├── grid_row_end.c │ │ │ │ ├── grid_row_start.c │ │ │ │ ├── grid_template_columns.c │ │ │ │ ├── grid_template_rows.c │ │ │ │ ├── list_style.c │ │ │ │ ├── list_style_type.c │ │ │ │ ├── margin.c │ │ │ │ ├── opacity.c │ │ │ │ ├── outline.c │ │ │ │ ├── overflow.c │ │ │ │ ├── padding.c │ │ │ │ ├── pause.c │ │ │ │ ├── play_during.c │ │ │ │ ├── properties.c │ │ │ │ ├── properties.gen │ │ │ │ ├── properties.h │ │ │ │ ├── quotes.c │ │ │ │ ├── stop_opacity.c │ │ │ │ ├── stroke.c │ │ │ │ ├── stroke_dasharray.c │ │ │ │ ├── stroke_opacity.c │ │ │ │ ├── text_decoration.c │ │ │ │ ├── text_overflow.c │ │ │ │ ├── text_shadow.c │ │ │ │ ├── utils.c │ │ │ │ ├── utils.h │ │ │ │ └── voice_family.c │ │ │ ├── propstrings.c │ │ │ └── propstrings.h │ │ ├── select │ │ │ ├── arena.c │ │ │ ├── arena.h │ │ │ ├── arena_hash.h │ │ │ ├── assets.py │ │ │ ├── autogenerated_computed.h │ │ │ ├── autogenerated_propget.h │ │ │ ├── autogenerated_propset.h │ │ │ ├── bloom.h │ │ │ ├── computed.c │ │ │ ├── computed.h │ │ │ ├── dispatch.c │ │ │ ├── dispatch.h │ │ │ ├── font_face.c │ │ │ ├── font_face.h │ │ │ ├── hash.c │ │ │ ├── hash.h │ │ │ ├── mq.h │ │ │ ├── overrides.py │ │ │ ├── properties │ │ │ │ ├── align_content.c │ │ │ │ ├── align_items.c │ │ │ │ ├── align_self.c │ │ │ │ ├── azimuth.c │ │ │ │ ├── background_attachment.c │ │ │ │ ├── background_color.c │ │ │ │ ├── background_image.c │ │ │ │ ├── background_position.c │ │ │ │ ├── background_repeat.c │ │ │ │ ├── baseline_shift.c │ │ │ │ ├── border_bottom_color.c │ │ │ │ ├── border_bottom_left_radius.c │ │ │ │ ├── border_bottom_right_radius.c │ │ │ │ ├── border_bottom_style.c │ │ │ │ ├── border_bottom_width.c │ │ │ │ ├── border_collapse.c │ │ │ │ ├── border_left_color.c │ │ │ │ ├── border_left_style.c │ │ │ │ ├── border_left_width.c │ │ │ │ ├── border_right_color.c │ │ │ │ ├── border_right_style.c │ │ │ │ ├── border_right_width.c │ │ │ │ ├── border_spacing.c │ │ │ │ ├── border_top_color.c │ │ │ │ ├── border_top_left_radius.c │ │ │ │ ├── border_top_right_radius.c │ │ │ │ ├── border_top_style.c │ │ │ │ ├── border_top_width.c │ │ │ │ ├── bottom.c │ │ │ │ ├── box_sizing.c │ │ │ │ ├── break_after.c │ │ │ │ ├── break_before.c │ │ │ │ ├── break_inside.c │ │ │ │ ├── caption_side.c │ │ │ │ ├── clear.c │ │ │ │ ├── clip.c │ │ │ │ ├── clip_path.c │ │ │ │ ├── clip_rule.c │ │ │ │ ├── color.c │ │ │ │ ├── column_count.c │ │ │ │ ├── column_fill.c │ │ │ │ ├── column_gap.c │ │ │ │ ├── column_rule_color.c │ │ │ │ ├── column_rule_style.c │ │ │ │ ├── column_rule_width.c │ │ │ │ ├── column_span.c │ │ │ │ ├── column_width.c │ │ │ │ ├── comp_op.c │ │ │ │ ├── content.c │ │ │ │ ├── counter_increment.c │ │ │ │ ├── counter_reset.c │ │ │ │ ├── cue_after.c │ │ │ │ ├── cue_before.c │ │ │ │ ├── cursor.c │ │ │ │ ├── direction.c │ │ │ │ ├── display.c │ │ │ │ ├── elevation.c │ │ │ │ ├── empty_cells.c │ │ │ │ ├── enable_background.c │ │ │ │ ├── fill.c │ │ │ │ ├── fill_opacity.c │ │ │ │ ├── fill_rule.c │ │ │ │ ├── filter.c │ │ │ │ ├── flex_basis.c │ │ │ │ ├── flex_direction.c │ │ │ │ ├── flex_grow.c │ │ │ │ ├── flex_shrink.c │ │ │ │ ├── flex_wrap.c │ │ │ │ ├── float.c │ │ │ │ ├── flood_color.c │ │ │ │ ├── flood_opacity.c │ │ │ │ ├── font_family.c │ │ │ │ ├── font_size.c │ │ │ │ ├── font_stretch.c │ │ │ │ ├── font_style.c │ │ │ │ ├── font_variant.c │ │ │ │ ├── font_weight.c │ │ │ │ ├── grid_column_end.c │ │ │ │ ├── grid_column_start.c │ │ │ │ ├── grid_row_end.c │ │ │ │ ├── grid_row_start.c │ │ │ │ ├── grid_template_columns.c │ │ │ │ ├── grid_template_rows.c │ │ │ │ ├── height.c │ │ │ │ ├── helpers.c │ │ │ │ ├── helpers.h │ │ │ │ ├── justify_content.c │ │ │ │ ├── left.c │ │ │ │ ├── letter_spacing.c │ │ │ │ ├── line_height.c │ │ │ │ ├── list_style_image.c │ │ │ │ ├── list_style_position.c │ │ │ │ ├── list_style_type.c │ │ │ │ ├── margin_bottom.c │ │ │ │ ├── margin_left.c │ │ │ │ ├── margin_right.c │ │ │ │ ├── margin_top.c │ │ │ │ ├── marker_end.c │ │ │ │ ├── marker_mid.c │ │ │ │ ├── marker_start.c │ │ │ │ ├── mask.c │ │ │ │ ├── max_height.c │ │ │ │ ├── max_width.c │ │ │ │ ├── min_height.c │ │ │ │ ├── min_width.c │ │ │ │ ├── opacity.c │ │ │ │ ├── order.c │ │ │ │ ├── orphans.c │ │ │ │ ├── outline_color.c │ │ │ │ ├── outline_style.c │ │ │ │ ├── outline_width.c │ │ │ │ ├── overflow_x.c │ │ │ │ ├── overflow_y.c │ │ │ │ ├── padding_bottom.c │ │ │ │ ├── padding_left.c │ │ │ │ ├── padding_right.c │ │ │ │ ├── padding_top.c │ │ │ │ ├── page_break_after.c │ │ │ │ ├── page_break_before.c │ │ │ │ ├── page_break_inside.c │ │ │ │ ├── pause_after.c │ │ │ │ ├── pause_before.c │ │ │ │ ├── pitch.c │ │ │ │ ├── pitch_range.c │ │ │ │ ├── play_during.c │ │ │ │ ├── position.c │ │ │ │ ├── properties.h │ │ │ │ ├── quotes.c │ │ │ │ ├── richness.c │ │ │ │ ├── right.c │ │ │ │ ├── shape_rendering.c │ │ │ │ ├── speak.c │ │ │ │ ├── speak_header.c │ │ │ │ ├── speak_numeral.c │ │ │ │ ├── speak_punctuation.c │ │ │ │ ├── speech_rate.c │ │ │ │ ├── stop_color.c │ │ │ │ ├── stop_opacity.c │ │ │ │ ├── stress.c │ │ │ │ ├── stroke.c │ │ │ │ ├── stroke_dasharray.c │ │ │ │ ├── stroke_dashoffset.c │ │ │ │ ├── stroke_linecap.c │ │ │ │ ├── stroke_linejoin.c │ │ │ │ ├── stroke_miterlimit.c │ │ │ │ ├── stroke_opacity.c │ │ │ │ ├── stroke_width.c │ │ │ │ ├── table_layout.c │ │ │ │ ├── text_align.c │ │ │ │ ├── text_align_last.c │ │ │ │ ├── text_anchor.c │ │ │ │ ├── text_decoration.c │ │ │ │ ├── text_indent.c │ │ │ │ ├── text_justify.c │ │ │ │ ├── text_overflow.c │ │ │ │ ├── text_rendering.c │ │ │ │ ├── text_shadow.c │ │ │ │ ├── text_transform.c │ │ │ │ ├── top.c │ │ │ │ ├── unicode_bidi.c │ │ │ │ ├── vertical_align.c │ │ │ │ ├── visibility.c │ │ │ │ ├── voice_family.c │ │ │ │ ├── volume.c │ │ │ │ ├── white_space.c │ │ │ │ ├── widows.c │ │ │ │ ├── width.c │ │ │ │ ├── word_break.c │ │ │ │ ├── word_spacing.c │ │ │ │ ├── word_wrap.c │ │ │ │ ├── writing_mode.c │ │ │ │ └── z_index.c │ │ │ ├── propget.h │ │ │ ├── propset.h │ │ │ ├── select.c │ │ │ ├── select.h │ │ │ ├── select_config.py │ │ │ └── select_generator.py │ │ ├── stylesheet.c │ │ ├── stylesheet.h │ │ └── utils │ │ │ ├── errors.c │ │ │ ├── parserutilserror.h │ │ │ ├── utils.c │ │ │ └── utils.h │ └── test │ │ ├── INDEX │ │ ├── README │ │ ├── csdetect.c │ │ ├── css21.c │ │ ├── data │ │ ├── csdetect │ │ │ ├── INDEX │ │ │ ├── bom-charset.dat │ │ │ └── bom.dat │ │ ├── css │ │ │ ├── INDEX │ │ │ ├── allzengarden.css │ │ │ ├── badcomment.css │ │ │ ├── blocks.css │ │ │ ├── color.css │ │ │ ├── fontface.css │ │ │ ├── malformed.css │ │ │ └── simple.css │ │ ├── lex │ │ │ ├── INDEX │ │ │ ├── regression.dat │ │ │ ├── tests1.dat │ │ │ └── tests2.dat │ │ ├── number │ │ │ ├── INDEX │ │ │ └── number.dat │ │ ├── parse │ │ │ ├── INDEX │ │ │ ├── README │ │ │ ├── atrules.dat │ │ │ ├── colours-hsl.dat │ │ │ ├── colours.dat │ │ │ ├── makefixed.pl │ │ │ ├── makeopv.pl │ │ │ ├── nth.dat │ │ │ ├── properties.dat │ │ │ ├── selectors.dat │ │ │ └── tests1.dat │ │ ├── parse2 │ │ │ ├── INDEX │ │ │ ├── README │ │ │ ├── au.dat │ │ │ ├── bg.dat │ │ │ ├── bgpos.dat │ │ │ ├── border.dat │ │ │ ├── comments.dat │ │ │ ├── dodgy-media-block.dat │ │ │ ├── eof.dat │ │ │ ├── flexbox.dat │ │ │ ├── font.dat │ │ │ ├── illegal-values.dat │ │ │ ├── list.dat │ │ │ ├── malformed-declarations.dat │ │ │ ├── margin.dat │ │ │ ├── multicol.dat │ │ │ ├── outline.dat │ │ │ ├── overflow.dat │ │ │ ├── padding.dat │ │ │ ├── selectors.dat │ │ │ ├── tests1.dat │ │ │ ├── units.dat │ │ │ └── unknown-properties.dat │ │ └── select │ │ │ ├── INDEX │ │ │ └── tests1.dat │ │ ├── dump.h │ │ ├── dump_computed.h │ │ ├── lex-auto.c │ │ ├── lex.c │ │ ├── number.c │ │ ├── parse-auto.c │ │ ├── parse.c │ │ ├── parse2-auto.c │ │ ├── select.c │ │ └── testutils.h ├── libparserutils │ ├── CMakeLists.txt │ ├── COPYING │ ├── Makefile.config │ ├── Makefile.orig │ ├── README │ ├── docs │ │ └── Todo │ ├── include │ │ └── parserutils │ │ │ ├── charset │ │ │ ├── codec.h │ │ │ ├── mibenum.h │ │ │ ├── utf16.h │ │ │ └── utf8.h │ │ │ ├── errors.h │ │ │ ├── functypes.h │ │ │ ├── input │ │ │ └── inputstream.h │ │ │ ├── parserutils.h │ │ │ ├── types.h │ │ │ └── utils │ │ │ ├── buffer.h │ │ │ ├── stack.h │ │ │ └── vector.h │ ├── libparserutils.pc.in │ ├── src │ │ ├── charset │ │ │ ├── aliases.c │ │ │ ├── aliases.h │ │ │ ├── aliases.inc │ │ │ ├── codec.c │ │ │ ├── codecs │ │ │ │ ├── 8859_tables.h │ │ │ │ ├── codec_8859.c │ │ │ │ ├── codec_ascii.c │ │ │ │ ├── codec_ext8.c │ │ │ │ ├── codec_impl.h │ │ │ │ ├── codec_utf16.c │ │ │ │ ├── codec_utf8.c │ │ │ │ └── ext8_tables.h │ │ │ └── encodings │ │ │ │ ├── utf16.c │ │ │ │ ├── utf8.c │ │ │ │ └── utf8impl.h │ │ ├── input │ │ │ ├── filter.c │ │ │ ├── filter.h │ │ │ └── inputstream.c │ │ └── utils │ │ │ ├── buffer.c │ │ │ ├── endian.h │ │ │ ├── errors.c │ │ │ ├── stack.c │ │ │ ├── utils.h │ │ │ └── vector.c │ └── test │ │ ├── INDEX │ │ ├── README │ │ ├── aliases.c │ │ ├── cscodec-8859.c │ │ ├── cscodec-ext8.c │ │ ├── cscodec-utf16.c │ │ ├── cscodec-utf8.c │ │ ├── data │ │ ├── cscodec-8859 │ │ │ ├── 1.dat │ │ │ ├── 10.dat │ │ │ ├── 11.dat │ │ │ ├── 13.dat │ │ │ ├── 14.dat │ │ │ ├── 15.dat │ │ │ ├── 16.dat │ │ │ ├── 2.dat │ │ │ ├── 3.dat │ │ │ ├── 4.dat │ │ │ ├── 5.dat │ │ │ ├── 6.dat │ │ │ ├── 7.dat │ │ │ ├── 8.dat │ │ │ ├── 9.dat │ │ │ └── INDEX │ │ ├── cscodec-ext8 │ │ │ ├── INDEX │ │ │ ├── cp1250.dat │ │ │ ├── cp1251.dat │ │ │ ├── cp1252.dat │ │ │ ├── cp1253.dat │ │ │ ├── cp1254.dat │ │ │ ├── cp1255.dat │ │ │ ├── cp1256.dat │ │ │ ├── cp1257.dat │ │ │ └── cp1258.dat │ │ ├── cscodec-utf16 │ │ │ ├── INDEX │ │ │ └── simple.dat │ │ ├── cscodec-utf8 │ │ │ ├── INDEX │ │ │ ├── UTF-8-test.txt │ │ │ └── simple.dat │ │ └── input │ │ │ ├── INDEX │ │ │ └── UTF-8-test.txt │ │ ├── filter.c │ │ ├── inputstream.c │ │ ├── regression │ │ ├── INDEX │ │ ├── buffer-discard.c │ │ ├── filter-badenc-segv.c │ │ ├── filter-segv.c │ │ └── stream-nomem.c │ │ └── testutils.h └── libwapcaplet │ ├── CMakeLists.txt │ ├── COPYING │ ├── Makefile.orig │ ├── README │ ├── docs │ └── Doxyfile │ ├── include │ └── libwapcaplet │ │ └── libwapcaplet.h │ ├── libwapcaplet.pc.in │ ├── src │ └── libwapcaplet.c │ └── test │ ├── basictests.c │ ├── testmain.c │ └── tests.h └── tools └── debian ├── changelog ├── compat ├── control ├── copyright ├── rules └── source └── format /.gitignore: -------------------------------------------------------------------------------- 1 | # Specific directories that shoud be ignored 2 | /src/out/ 3 | lib*.so 4 | hiacejs_test 5 | build.sh 6 | 7 | # CMake 8 | cmake-build-*/ 9 | CMakeLists.txt.user 10 | CMakeCache.txt 11 | CMakeFiles 12 | CMakeScripts 13 | Testing 14 | Makefile 15 | cmake_install.cmake 16 | install_manifest.txt 17 | compile_commands.json 18 | CTestTestfile.cmake 19 | _deps 20 | 21 | #output 22 | output 23 | hiacejs_test 24 | hiacejs_run 25 | node_test 26 | *.pc 27 | .build 28 | *.so.* 29 | 30 | 31 | #log 32 | *.log 33 | log 34 | 35 | #test 36 | css_select_test 37 | css_select_test2 38 | test/layout_test 39 | *.a 40 | #bin 41 | gen_parser 42 | *.pyc 43 | 44 | doc-api-ref-hidomlayout-1.0.0 45 | 46 | build 47 | -------------------------------------------------------------------------------- /code-tools/select/assets.py: -------------------------------------------------------------------------------- 1 | # This file is part of LibCSS. 2 | # Licensed under the MIT License, 3 | # http://www.opensource.org/licenses/mit-license.php 4 | # Copyright 2017 Lucas Neves 5 | # Copyright (C) 2021 Beijing FMSoft Technologies Co., Ltd. 6 | 7 | copyright = '''\ 8 | /* 9 | * This file is part of LibCSS 10 | * Licensed under the MIT License, 11 | * http://www.opensource.org/licenses/mit-license.php 12 | * Copyright 2017 The NetSurf Project 13 | */ 14 | ''' 15 | 16 | assets = {} 17 | 18 | assets['computed.h'] = {} 19 | assets['computed.h']['header'] = copyright 20 | assets['computed.h']['footer'] = '' 21 | 22 | assets['propset.h'] = {} 23 | assets['propset.h']['header'] = copyright + ''' 24 | /** Default values are 'initial value', unless the property is inherited, 25 | * in which case it is 'inherit'. */''' 26 | assets['propset.h']['footer'] = '' 27 | 28 | assets['propget.h'] = {} 29 | assets['propget.h']['header'] = copyright 30 | assets['propget.h']['footer'] = '' 31 | 32 | -------------------------------------------------------------------------------- /src/layout/domruler.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: DOM Ruler 7 | Description: A library to maintain a DOM tree, lay out and stylize the DOM elements by using CSS. 8 | Version: 1.2.1 9 | Requires: glib-2.0 10 | Libs: -L${libdir} -ldomruler 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/samples/layout_html/window.css: -------------------------------------------------------------------------------- 1 | section { 2 | position:fixed; 3 | left:0; 4 | top:0; 5 | height:100%; 6 | width:100%; 7 | } 8 | 9 | .header { 10 | height: 20%; 11 | min-height: 100px; 12 | } 13 | 14 | .mainBody { 15 | display:flex; 16 | flex-direction: column; 17 | height: 80px; 18 | } 19 | 20 | .plainwindow { 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/test/block_and_page_inline_block.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: block; 8 | position: relative; 9 | left: 70%; 10 | width: 70%; 11 | height: 20%; 12 | color: #123; 13 | } 14 | 15 | #description { 16 | display: block; 17 | position: relative; 18 | width: 40%; 19 | height: 10%; 20 | color: #124; 21 | } 22 | 23 | #page { 24 | display: block; 25 | position: relative; 26 | width: 50%; 27 | height: 60%; 28 | color: #125; 29 | } 30 | 31 | #indicator { 32 | display: block; 33 | position: relative; 34 | width: 10%; 35 | height: 10%; 36 | color: #126; 37 | } 38 | 39 | hiweb { 40 | display: inline-block; 41 | position: relative; 42 | width: 50%; 43 | height: 25%; 44 | color: #127; 45 | font-family: "Times New Roman", Times, serif; 46 | font-size:10px; 47 | } 48 | 49 | #hiweb2 { 50 | display: inline-block; 51 | position: relative; 52 | width: auto; 53 | height: 25%; 54 | color: #127; 55 | font-family: "Times New Roman", Times, serif; 56 | font-size:10px; 57 | } 58 | 59 | hijs { 60 | display: inline-block; 61 | position: relative; 62 | width: auto; 63 | height: 50%; 64 | color: #128; 65 | background:red; 66 | } 67 | 68 | #hijs2 { 69 | display: inline-block; 70 | position: relative; 71 | width: auto; 72 | height: 50%; 73 | color: #128; 74 | background:red; 75 | } 76 | -------------------------------------------------------------------------------- /src/test/block_inline_block.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: block; 8 | position: relative; 9 | left:25%; 10 | top:15%; 11 | width: 50%; 12 | height: 50%; 13 | color: #123; 14 | } 15 | 16 | #description { 17 | display: inline-block; 18 | position: relative; 19 | left:40%; 20 | top:0%; 21 | width: 4%; 22 | height: 4%; 23 | color: #124; 24 | } 25 | 26 | #page { 27 | display:inline-grid; 28 | position: relative; 29 | grid-template-columns: 25% 25% 25% 25%; 30 | grid-template-rows: 25% 25% 25% 25%; 31 | left:52%; 32 | width: 4%; 33 | height: 4%; 34 | } 35 | 36 | #indicator { 37 | display: inline-block; 38 | position: relative; 39 | left:0%; 40 | top:0%; 41 | width: 100%; 42 | height: 5%; 43 | color: #126; 44 | } 45 | 46 | #hiweb { 47 | color: #127; 48 | font-size:10px; 49 | grid-row-start:2; 50 | grid-row-end:3; 51 | grid-column-start:2; 52 | grid-column-end:3; 53 | } 54 | 55 | #hiweb2 { 56 | color: #127; 57 | font-size:10px; 58 | grid-row-start:3; 59 | grid-row-end:4; 60 | grid-column-start:4; 61 | grid-column-end:5; 62 | } 63 | 64 | #hijs { 65 | color: #128; 66 | background:red; 67 | } 68 | 69 | #hijs2 { 70 | color: #128; 71 | background:red; 72 | } 73 | -------------------------------------------------------------------------------- /src/test/fixed.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: block; 8 | position: relative; 9 | left: 70%; 10 | width: 70%; 11 | height: 20%; 12 | color: #123; 13 | } 14 | 15 | #description { 16 | display: block; 17 | position: relative; 18 | width: 40%; 19 | height: 10%; 20 | color: #124; 21 | } 22 | 23 | #page { 24 | display: block; 25 | position: relative; 26 | width: 50%; 27 | height: 60%; 28 | color: #125; 29 | } 30 | 31 | #indicator { 32 | display: block; 33 | position: relative; 34 | width: 10%; 35 | height: 10%; 36 | color: #126; 37 | } 38 | 39 | hiweb { 40 | display: inline-block; 41 | position: relative; 42 | width: 50%; 43 | height: 25%; 44 | color: #127; 45 | font-family: "Times New Roman", Times, serif; 46 | font-size:10px; 47 | } 48 | 49 | #hiweb2 { 50 | display: inline-block; 51 | position: relative; 52 | width: auto; 53 | height: 25%; 54 | color: #127; 55 | font-family: "Times New Roman", Times, serif; 56 | font-size:10px; 57 | } 58 | 59 | hijs { 60 | display: inline-block; 61 | position: fixed; 62 | left: 0%; 63 | top: 0%; 64 | width: 100%; 65 | height: 50%; 66 | color: #128; 67 | background:red; 68 | } 69 | 70 | #hijs2 { 71 | display: inline-block; 72 | position: fixed; 73 | left: 50%; 74 | top: 50%; 75 | width: 50%; 76 | height: 50%; 77 | color: #128; 78 | background:red; 79 | } 80 | -------------------------------------------------------------------------------- /src/test/fixed2.txt: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: block; 8 | position: relative; 9 | left: 70%; 10 | width: 70%; 11 | height: 20%; 12 | color: #123; 13 | } 14 | 15 | #description { 16 | display: block; 17 | position: relative; 18 | width: 40%; 19 | height: 10%; 20 | color: #124; 21 | } 22 | 23 | #page { 24 | display: block; 25 | position: relative; 26 | width: 50%; 27 | height: 60%; 28 | color: #125; 29 | } 30 | 31 | #indicator { 32 | display: block; 33 | position: relative; 34 | width: 10%; 35 | height: 10%; 36 | color: #126; 37 | } 38 | 39 | hiweb { 40 | display: inline-block; 41 | position: fixed; 42 | left: 50px; 43 | top: 10px; 44 | width: 100px; 45 | height: 25%; 46 | color: #127; 47 | font-family: "Times New Roman", Times, serif; 48 | font-size:10px; 49 | } 50 | 51 | #hiweb2 { 52 | display: inline-block; 53 | position: fixed; 54 | left: 100px; 55 | top: 20px; 56 | height: 25%; 57 | color: #127; 58 | font-family: "Times New Roman", Times, serif; 59 | font-size:10px; 60 | } 61 | 62 | hijs { 63 | display: inline-block; 64 | position: relative; 65 | width: auto; 66 | height: 50%; 67 | color: #128; 68 | background:red; 69 | } 70 | 71 | #hijs2 { 72 | display: inline-block; 73 | position: relative; 74 | width: auto; 75 | height: 50%; 76 | color: #128; 77 | background:red; 78 | } 79 | -------------------------------------------------------------------------------- /src/test/fixed3.txt: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: block; 8 | position: relative; 9 | left: 70%; 10 | width: 70%; 11 | height: 20%; 12 | color: #123; 13 | } 14 | 15 | #description { 16 | display: block; 17 | position: relative; 18 | width: 40%; 19 | height: 10%; 20 | color: #124; 21 | } 22 | 23 | #page { 24 | display: block; 25 | position: relative; 26 | width: 50%; 27 | height: 60%; 28 | color: #125; 29 | } 30 | 31 | #indicator { 32 | display: block; 33 | position: relative; 34 | width: 10%; 35 | height: 10%; 36 | color: #126; 37 | } 38 | 39 | hiweb { 40 | display: inline-block; 41 | position: fixed; 42 | left: 50px; 43 | top: 10px; 44 | width: 100px; 45 | height: 25%; 46 | color: #127; 47 | font-family: "Times New Roman", Times, serif; 48 | font-size:10px; 49 | } 50 | 51 | #hiweb2 { 52 | display: inline-block; 53 | position: relative; 54 | width: 30%; 55 | height: 50%; 56 | color: #127; 57 | font-family: "Times New Roman", Times, serif; 58 | font-size:10px; 59 | } 60 | 61 | hijs { 62 | display: inline-block; 63 | position: fixed; 64 | left: 100px; 65 | top: 20px; 66 | width: 50%; 67 | height: 25%; 68 | color: #128; 69 | background:red; 70 | } 71 | 72 | #hijs2 { 73 | display: inline-block; 74 | position: relative; 75 | width: 30%; 76 | height: 50%; 77 | color: #128; 78 | background:red; 79 | } 80 | -------------------------------------------------------------------------------- /src/test/grid.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: inline-block; 8 | position: relative; 9 | left:0%; 10 | top:0%; 11 | width: 50%; 12 | height: 5%; 13 | color: #123; 14 | } 15 | 16 | #description { 17 | display: inline-block; 18 | position: relative; 19 | left:0%; 20 | top:0%; 21 | width: 50%; 22 | height: 5%; 23 | color: #124; 24 | } 25 | 26 | #page { 27 | display:grid; 28 | grid-template-columns: 25% 25% 25% 25%; 29 | grid-template-rows: 25% 25% 25% 25%; 30 | width: 100%; 31 | height: 85%; 32 | } 33 | 34 | #indicator { 35 | display: inline-block; 36 | position: relative; 37 | left:0%; 38 | top:0%; 39 | width: 100%; 40 | height: 5%; 41 | color: #126; 42 | } 43 | 44 | #hiweb { 45 | color: #127; 46 | font-size:10px; 47 | grid-row-start:2; 48 | grid-row-end:3; 49 | grid-column-start:2; 50 | grid-column-end:3; 51 | } 52 | 53 | #hiweb2 { 54 | color: #127; 55 | font-size:10px; 56 | grid-row-start:3; 57 | grid-row-end:4; 58 | grid-column-start:4; 59 | grid-column-end:5; 60 | } 61 | 62 | #hijs { 63 | color: #128; 64 | background:red; 65 | } 66 | 67 | #hijs2 { 68 | color: #128; 69 | background:red; 70 | } 71 | -------------------------------------------------------------------------------- /src/test/layout_1.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | position: relative; 8 | left: 20%; 9 | width: 100%; 10 | height: 20%; 11 | color: #123; 12 | } 13 | 14 | #description { 15 | position: relative; 16 | width: 100%; 17 | height: 10%; 18 | color: #124; 19 | } 20 | 21 | #page { 22 | position: relative; 23 | width: 100%; 24 | height: 60%; 25 | color: #125; 26 | } 27 | 28 | #indicator { 29 | position: relative; 30 | width: 100%; 31 | height: 10%; 32 | color: #126; 33 | } 34 | 35 | hiweb { 36 | position: relative; 37 | width: 100%; 38 | height: 25%; 39 | color: #127; 40 | font-family: "Times New Roman", Times, serif; 41 | font-size:10px; 42 | } 43 | 44 | hijs { 45 | position: relative; 46 | width: 100%; 47 | height: 50%; 48 | color: #128; 49 | background:red; 50 | } 51 | -------------------------------------------------------------------------------- /src/test/layout_2.css: -------------------------------------------------------------------------------- 1 | #root { 2 | display: block; 3 | color: blue; 4 | } 5 | 6 | #title { 7 | display: inline-block; 8 | position: relative; 9 | left: 70%; 10 | width: 70%; 11 | height: 20%; 12 | color: #123; 13 | } 14 | 15 | #description { 16 | display: inline-block; 17 | position: relative; 18 | width: 40%; 19 | height: 10%; 20 | color: #124; 21 | } 22 | 23 | #page { 24 | display: inline-block; 25 | position: relative; 26 | width: 50%; 27 | height: 60%; 28 | color: #125; 29 | } 30 | 31 | #indicator { 32 | display: inline-block; 33 | position: relative; 34 | width: 10%; 35 | height: 10%; 36 | color: #126; 37 | } 38 | 39 | hiweb { 40 | position: relative; 41 | width: 50%; 42 | height: 25%; 43 | color: #127; 44 | font-family: "Times New Roman", Times, serif; 45 | font-size:10px; 46 | } 47 | 48 | hiweb2 { 49 | position: relative; 50 | width: 50%; 51 | height: 25%; 52 | color: #127; 53 | font-family: "Times New Roman", Times, serif; 54 | font-size:10px; 55 | } 56 | 57 | hijs { 58 | position: relative; 59 | width: 50%; 60 | height: 50%; 61 | color: #128; 62 | background:red; 63 | } 64 | 65 | hijs2 { 66 | position: relative; 67 | width: 50%; 68 | height: 50%; 69 | color: #128; 70 | background:red; 71 | } 72 | -------------------------------------------------------------------------------- /src/third-party/libcss/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2007 J-M Bell 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | * The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/third-party/libcss/Makefile.config: -------------------------------------------------------------------------------- 1 | # Configuration Makefile fragment 2 | 3 | # Cater for local configuration changes 4 | -include Makefile.config.override 5 | -------------------------------------------------------------------------------- /src/third-party/libcss/README: -------------------------------------------------------------------------------- 1 | LibCSS -- a CSS parser and selection engine 2 | =========================================== 3 | 4 | Overview 5 | -------- 6 | 7 | LibCSS is a CSS parser and selection engine. It aims to parse the forward 8 | compatible CSS grammar. 9 | 10 | Requirements 11 | ------------ 12 | 13 | LibCSS requires the following tools: 14 | 15 | + A C99 capable C compiler 16 | + GNU make or compatible 17 | + Pkg-config 18 | + Perl (for the testcases) 19 | + Python3 (minimum 3.6, for generated selection code) 20 | 21 | LibCSS also requires the following libraries to be installed: 22 | 23 | + LibParserUtils 24 | + LibWapcaplet 25 | 26 | Compilation 27 | ----------- 28 | 29 | If necessary, modify the toolchain settings in the Makefile. 30 | Invoke make: 31 | 32 | $ make 33 | 34 | Regenerating generated selection source code 35 | -------------------------------------------- 36 | 37 | To regenerate the selection sources (computed style data accesses), 38 | note this requires python3: 39 | 40 | $ make select_generator 41 | 42 | Verification 43 | ------------ 44 | 45 | To verify that the parser is working, it is necessary to specify a 46 | different makefile target than that used for normal compilation, thus: 47 | 48 | $ make test 49 | 50 | API documentation 51 | ----------------- 52 | 53 | Currently, there is none. However, the code is well commented and the 54 | public API may be found in the "include" directory. The testcase sources 55 | may also be of use in working out how to use it. 56 | 57 | -------------------------------------------------------------------------------- /src/third-party/libcss/docs/Colour: -------------------------------------------------------------------------------- 1 | The exported representation of colours is an unsigned 32bit value in host order 2 | 3 | The value is divided into four 8bit channels. These are: 4 | 5 | Bits Name Desciption 6 | 0-7 Blue The blue intensity of the colour 0 is off 0xff is fully on 7 | 8-15 Green The green intensity of the colour 0 is off 0xff is fully on 8 | 16-23 Red The red intensity of the colour 0 is off 0xff is fully on 9 | 24-31 Alpha The Alpha component represents the opacity of the colour 0 is fully transparent and 0xff is opaque 10 | 11 | -------------------------------------------------------------------------------- /src/third-party/libcss/docs/Lexer: -------------------------------------------------------------------------------- 1 | Lexical analyser 2 | ================ 3 | 4 | This document contains various snippets of information about the lexer 5 | implementation. 6 | 7 | First sets 8 | ---------- 9 | 10 | IDENT [a-zA-Z] | '-' | '_' | [^#x0-#x7F] | '\' 11 | ATKEYWORD '@' 12 | STRING '"' | "'" 13 | INVALID_STRING '"' | "'" 14 | HASH '#' 15 | NUMBER [0-9] | '.' | '-' | '+' 16 | PERCENTAGE [0-9] | '.' | '-' | '+' 17 | DIMENSION [0-9] | '.' 18 | URI [Uu] 19 | UNICODE-RANGE [Uu] 20 | CDO '<' 21 | CDC '-' 22 | S #x9 | #xA | #xC | #xD | #x20 23 | COMMENT '/' 24 | FUNCTION [a-zA-Z] | '-' | '_' | [^#x0-#x7F] | '\' 25 | INCLUDES '~' 26 | DASHMATCH '|' 27 | PREFIXMATCH '^' 28 | SUFFIXMATCH '$' 29 | SUBSTRINGMATCH '*' 30 | CHAR anything except " or ' 31 | 32 | -------------------------------------------------------------------------------- /src/third-party/libcss/hicss.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include/hicss 5 | 6 | Name: libhicss 7 | Description: hiCSS parsing and selection library 8 | Version: 0.1 9 | Libs: -L${libdir} -lhicss 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/third-party/libcss/include/libcss/errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef libcss_errors_h_ 9 | #define libcss_errors_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | typedef enum css_error { 19 | CSS_OK = 0, 20 | 21 | CSS_NOMEM = 1, 22 | CSS_BADPARM = 2, 23 | CSS_INVALID = 3, 24 | CSS_FILENOTFOUND = 4, 25 | CSS_NEEDDATA = 5, 26 | CSS_BADCHARSET = 6, 27 | CSS_EOF = 7, 28 | CSS_IMPORTS_PENDING = 8, 29 | CSS_PROPERTY_NOT_SET = 9 30 | } css_error; 31 | 32 | /* Convert a libcss error value to a string */ 33 | const char *css_error_to_string(css_error error); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/include/libcss/functypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007-8 John-Mark Bell 6 | */ 7 | 8 | #ifndef libcss_functypes_h_ 9 | #define libcss_functypes_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /src/third-party/libcss/include/libcss/hint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef libcss_hint_h_ 9 | #define libcss_hint_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | /** 24 | * Length object for use in presentational hints 25 | */ 26 | typedef struct css_hint_length { 27 | css_fixed value; 28 | css_unit unit; 29 | } css_hint_length; 30 | 31 | /** 32 | * Presentational hints 33 | */ 34 | typedef struct css_hint { 35 | /* Ownership of all data is passed to libcss */ 36 | union { 37 | css_computed_clip_rect *clip; 38 | css_color color; 39 | css_computed_content_item *content; 40 | css_computed_counter *counter; 41 | css_fixed fixed; 42 | int32_t integer; 43 | css_hint_length length; 44 | struct { 45 | css_hint_length h; 46 | css_hint_length v; 47 | } position; 48 | lwc_string *string; 49 | lwc_string **strings; 50 | } data; 51 | 52 | uint32_t prop; /**< Property index */ 53 | uint8_t status; /**< Property value */ 54 | } css_hint; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/third-party/libcss/include/libcss/libcss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef libcss_h_ 9 | #define libcss_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /src/third-party/libcss/libcss.pc.in: -------------------------------------------------------------------------------- 1 | prefix=PREFIX 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/LIBDIR 4 | includedir=${prefix}/INCLUDEDIR 5 | 6 | Name: libcss 7 | Description: CSS parsing and selection library 8 | Version: VERSION 9 | Requires: libparserutils, libwapcaplet 10 | Libs: -L${libdir} -lcss 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/charset/detect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_charset_detect_h_ 9 | #define css_charset_detect_h_ 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | /* Extract a charset from a chunk of data */ 20 | parserutils_error css__charset_extract(const uint8_t *data, size_t len, 21 | uint16_t *mibenum, uint32_t *source); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/font_face.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2011 Things Made Out Of Other Things Ltd. 6 | * Written by James Montgomerie 7 | */ 8 | 9 | #ifndef css_parse_font_face_h_ 10 | #define css_parse_font_face_h_ 11 | 12 | #include 13 | 14 | #include "stylesheet.h" 15 | #include "lex/lex.h" 16 | #include "parse/language.h" 17 | 18 | css_error css__parse_font_descriptor(css_language *c, 19 | const css_token *descriptor, const parserutils_vector *vector, 20 | int *ctx, struct css_rule_font_face *rule); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/important.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_css__parse_important_h_ 9 | #define css_css__parse_important_h_ 10 | 11 | #include "stylesheet.h" 12 | #include "parse/language.h" 13 | 14 | css_error css__parse_important(css_language *c, 15 | const parserutils_vector *vector, int *ctx, 16 | uint8_t *result); 17 | 18 | void css__make_style_important(css_style *style); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_bottom:BORDER_SIDE_BOTTOM WRAP:css__parse_border_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_bottom 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_bottom(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_BOTTOM); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_bottom_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_bottom_color:CSS_PROP_BORDER_BOTTOM_COLOR WRAP:css__parse_border_side_color 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_bottom_color 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_bottom_color(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_color(c, vector, ctx, result, CSS_PROP_BORDER_BOTTOM_COLOR); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_bottom_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_bottom_style:CSS_PROP_BORDER_BOTTOM_STYLE WRAP:css__parse_border_side_style 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_bottom_style 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_bottom_style(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_style(c, vector, ctx, result, CSS_PROP_BORDER_BOTTOM_STYLE); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_bottom_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_bottom_width:CSS_PROP_BORDER_BOTTOM_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_bottom_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_bottom_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_BORDER_BOTTOM_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_left:BORDER_SIDE_LEFT WRAP:css__parse_border_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_left 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_left(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_LEFT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_left_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_left_color:CSS_PROP_BORDER_LEFT_COLOR WRAP:css__parse_border_side_color 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_left_color 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_left_color(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_color(c, vector, ctx, result, CSS_PROP_BORDER_LEFT_COLOR); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_left_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_left_style:CSS_PROP_BORDER_LEFT_STYLE WRAP:css__parse_border_side_style 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_left_style 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_left_style(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_style(c, vector, ctx, result, CSS_PROP_BORDER_LEFT_STYLE); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_left_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_left_width:CSS_PROP_BORDER_LEFT_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_left_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_left_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_BORDER_LEFT_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_right:BORDER_SIDE_RIGHT WRAP:css__parse_border_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_right 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_right(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_RIGHT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_right_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_right_color:CSS_PROP_BORDER_RIGHT_COLOR WRAP:css__parse_border_side_color 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_right_color 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_right_color(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_color(c, vector, ctx, result, CSS_PROP_BORDER_RIGHT_COLOR); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_right_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_right_style:CSS_PROP_BORDER_RIGHT_STYLE WRAP:css__parse_border_side_style 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_right_style 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_right_style(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_style(c, vector, ctx, result, CSS_PROP_BORDER_RIGHT_STYLE); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_right_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_right_width:CSS_PROP_BORDER_RIGHT_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_right_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_right_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_BORDER_RIGHT_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_top:BORDER_SIDE_TOP WRAP:css__parse_border_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_top 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_top(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_TOP); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_top_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_top_color:CSS_PROP_BORDER_TOP_COLOR WRAP:css__parse_border_side_color 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_top_color 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_top_color(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_color(c, vector, ctx, result, CSS_PROP_BORDER_TOP_COLOR); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_top_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_top_style:CSS_PROP_BORDER_TOP_STYLE WRAP:css__parse_border_side_style 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_top_style 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_top_style(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_style(c, vector, ctx, result, CSS_PROP_BORDER_TOP_STYLE); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_border_top_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * border_top_width:CSS_PROP_BORDER_TOP_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse border_top_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_border_top_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_BORDER_TOP_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * bottom:CSS_PROP_BOTTOM WRAP:css__parse_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse bottom 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_bottom(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_side(c, vector, ctx, result, CSS_PROP_BOTTOM); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_column_rule_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * column_rule_width:CSS_PROP_COLUMN_RULE_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse column_rule_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_column_rule_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_COLUMN_RULE_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_filter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * filter:CSS_PROP_FILTER WRAP:css__parse_filter_impl 7 | * 8 | * Copyright (C) 2021 Beijing FMSoft Technologies Co., Ltd. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "bytecode/bytecode.h" 15 | #include "bytecode/opcodes.h" 16 | #include "parse/properties/properties.h" 17 | #include "parse/properties/utils.h" 18 | 19 | /** 20 | * Parse filter 21 | * 22 | * \param c Parsing context 23 | * \param vector Vector of tokens to process 24 | * \param ctx Pointer to vector iteration context 25 | * \param result resulting style 26 | * \return CSS_OK on success, 27 | * CSS_NOMEM on memory exhaustion, 28 | * CSS_INVALID if the input is not valid 29 | * 30 | * Post condition: \a *ctx is updated with the next token to process 31 | * If the input is invalid, then \a *ctx remains unchanged. 32 | */ 33 | css_error css__parse_filter(css_language *c, 34 | const parserutils_vector *vector, int *ctx, 35 | css_style *result) 36 | { 37 | return css__parse_filter_impl(c, vector, ctx, result, CSS_PROP_FILTER); 38 | } 39 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * left:CSS_PROP_LEFT WRAP:css__parse_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse left 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_left(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_side(c, vector, ctx, result, CSS_PROP_LEFT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_margin_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * margin_bottom:CSS_PROP_MARGIN_BOTTOM WRAP:css__parse_margin_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse margin_bottom 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_margin_bottom(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_margin_side(c, vector, ctx, result, CSS_PROP_MARGIN_BOTTOM); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_margin_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * margin_left:CSS_PROP_MARGIN_LEFT WRAP:css__parse_margin_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse margin_left 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_margin_left(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_margin_side(c, vector, ctx, result, CSS_PROP_MARGIN_LEFT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_margin_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * margin_right:CSS_PROP_MARGIN_RIGHT WRAP:css__parse_margin_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse margin_right 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_margin_right(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_margin_side(c, vector, ctx, result, CSS_PROP_MARGIN_RIGHT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_margin_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * margin_top:CSS_PROP_MARGIN_TOP WRAP:css__parse_margin_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse margin_top 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_margin_top(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_margin_side(c, vector, ctx, result, CSS_PROP_MARGIN_TOP); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_outline_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * outline_width:CSS_PROP_OUTLINE_WIDTH WRAP:css__parse_border_side_width 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse outline_width 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_outline_width(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_border_side_width(c, vector, ctx, result, CSS_PROP_OUTLINE_WIDTH); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_padding_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * padding_bottom:CSS_PROP_PADDING_BOTTOM WRAP:css__parse_padding_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse padding_bottom 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_padding_bottom(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_padding_side(c, vector, ctx, result, CSS_PROP_PADDING_BOTTOM); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_padding_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * padding_left:CSS_PROP_PADDING_LEFT WRAP:css__parse_padding_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse padding_left 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_padding_left(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_padding_side(c, vector, ctx, result, CSS_PROP_PADDING_LEFT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_padding_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * padding_right:CSS_PROP_PADDING_RIGHT WRAP:css__parse_padding_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse padding_right 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_padding_right(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_padding_side(c, vector, ctx, result, CSS_PROP_PADDING_RIGHT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_padding_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * padding_top:CSS_PROP_PADDING_TOP WRAP:css__parse_padding_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse padding_top 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_padding_top(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_padding_side(c, vector, ctx, result, CSS_PROP_PADDING_TOP); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * right:CSS_PROP_RIGHT WRAP:css__parse_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse right 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_right(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_side(c, vector, ctx, result, CSS_PROP_RIGHT); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/parse/properties/autogenerated_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by LibCSS gen_parser 3 | * 4 | * Generated from: 5 | * 6 | * top:CSS_PROP_TOP WRAP:css__parse_side 7 | * 8 | * Licensed under the MIT License, 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * Copyright 2010 The NetSurf Browser Project. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "bytecode/bytecode.h" 17 | #include "bytecode/opcodes.h" 18 | #include "parse/properties/properties.h" 19 | #include "parse/properties/utils.h" 20 | 21 | /** 22 | * Parse top 23 | * 24 | * \param c Parsing context 25 | * \param vector Vector of tokens to process 26 | * \param ctx Pointer to vector iteration context 27 | * \param result resulting style 28 | * \return CSS_OK on success, 29 | * CSS_NOMEM on memory exhaustion, 30 | * CSS_INVALID if the input is not valid 31 | * 32 | * Post condition: \a *ctx is updated with the next token to process 33 | * If the input is invalid, then \a *ctx remains unchanged. 34 | */ 35 | css_error css__parse_top(css_language *c, 36 | const parserutils_vector *vector, int *ctx, 37 | css_style *result) 38 | { 39 | return css__parse_side(c, vector, ctx, result, CSS_PROP_TOP); 40 | } 41 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/arena.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * 6 | * Copyright 2015 Michael Drake 7 | */ 8 | 9 | #ifndef css_select_arena_h_ 10 | #define css_select_arena_h_ 11 | 12 | struct css_computed_style; 13 | 14 | /* 15 | * Add computed style to the style sharing arena, or exchange for existing 16 | * 17 | * This takes a computed style. Note that the original computed style 18 | * may be freed by this call and all future usage should be via the 19 | * updated computed style parameter. 20 | * 21 | * \params style The style to intern; possibly freed and updated 22 | * \return CSS_OK on success or appropriate error otherwise. 23 | */ 24 | enum css_error css__arena_intern_style(struct css_computed_style **style); 25 | 26 | /* 27 | * Remove a computed style from the style sharing arena 28 | * 29 | * \params style The style to remove from the style sharing arena 30 | * \return CSS_OK on success or appropriate error otherwise. 31 | */ 32 | enum css_error css__arena_remove_style(struct css_computed_style *style); 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/assets.py: -------------------------------------------------------------------------------- 1 | # This file is part of LibCSS. 2 | # Licensed under the MIT License, 3 | # http://www.opensource.org/licenses/mit-license.php 4 | # Copyright 2017 Lucas Neves 5 | 6 | copyright = '''\ 7 | /* 8 | * This file is part of LibCSS 9 | * Licensed under the MIT License, 10 | * http://www.opensource.org/licenses/mit-license.php 11 | * Copyright 2017 The NetSurf Project 12 | */ 13 | ''' 14 | 15 | assets = {} 16 | 17 | assets['computed.h'] = {} 18 | assets['computed.h']['header'] = copyright 19 | assets['computed.h']['footer'] = '' 20 | 21 | assets['propset.h'] = {} 22 | assets['propset.h']['header'] = copyright + ''' 23 | /** Default values are 'initial value', unless the property is inherited, 24 | * in which case it is 'inherit'. */''' 25 | assets['propset.h']['footer'] = '' 26 | 27 | assets['propget.h'] = {} 28 | assets['propget.h']['header'] = copyright 29 | assets['propget.h']['footer'] = '' 30 | 31 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/computed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_select_computed_h_ 9 | #define css_select_computed_h_ 10 | 11 | #include 12 | #include 13 | #include "autogenerated_computed.h" 14 | 15 | /** 16 | * Take a new reference to a computed style 17 | * 18 | * \param style The style to take a new reference to. 19 | * \return The new computed style reference 20 | */ 21 | static inline css_computed_style * css__computed_style_ref( 22 | css_computed_style *style) 23 | { 24 | if (style == NULL) 25 | return NULL; 26 | 27 | style->count++; 28 | return style; 29 | } 30 | 31 | css_error css__computed_style_create(css_computed_style **result); 32 | 33 | css_error css__computed_style_initialise(css_computed_style *style, 34 | struct css_select_handler *handler, void *pw); 35 | 36 | css_error css__compute_absolute_values(const css_computed_style *parent, 37 | css_computed_style *style, 38 | css_error (*compute_font_size)(void *pw, 39 | const css_hint *parent, css_hint *size), 40 | void *pw); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_select_dispatch_h_ 9 | #define css_select_dispatch_h_ 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include "stylesheet.h" 17 | #include "bytecode/bytecode.h" 18 | #include "select/select.h" 19 | 20 | extern struct prop_table { 21 | css_error (*cascade)(uint32_t opv, css_style *style, 22 | css_select_state *state); 23 | css_error (*set_from_hint)(const css_hint *hint, 24 | css_computed_style *style); 25 | css_error (*initial)(css_select_state *state); 26 | css_error (*compose)(const css_computed_style *parent, 27 | const css_computed_style *child, 28 | css_computed_style *result); 29 | unsigned int inherited; 30 | } prop_dispatch[CSS_N_PROPERTIES]; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/font_face.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2011 Things Made Out Of Other Things Ltd. 6 | * Written by James Montgomerie 7 | */ 8 | 9 | #ifndef css_select_font_face_h_ 10 | #define css_select_font_face_h_ 11 | 12 | #include 13 | 14 | 15 | struct css_font_face_src { 16 | lwc_string *location; 17 | /* 18 | * Bit allocations: 19 | * 20 | * 76543210 21 | * 1 _fffffll format | location type 22 | */ 23 | uint8_t bits[1]; 24 | }; 25 | 26 | struct css_font_face { 27 | lwc_string *font_family; 28 | css_font_face_src *srcs; 29 | uint32_t n_srcs; 30 | 31 | /* 32 | * Bit allocations: 33 | * 34 | * 76543210 35 | * 1 __wwwwss font-weight | font-style 36 | */ 37 | uint8_t bits[1]; 38 | }; 39 | 40 | css_error css__font_face_create(css_font_face **result); 41 | css_error css__font_face_destroy(css_font_face *font_face); 42 | 43 | css_error css__font_face_set_font_family(css_font_face *font_face, 44 | lwc_string *font_family); 45 | 46 | css_error css__font_face_set_srcs(css_font_face *font_face, 47 | css_font_face_src *srcs, uint32_t n_srcs); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/background_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_background_color(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_bg_border_color(opv, style, state, set_background_color); 21 | } 22 | 23 | css_error css__set_background_color_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_background_color(style, hint->status, hint->data.color); 27 | } 28 | 29 | css_error css__initial_background_color(css_select_state *state) 30 | { 31 | return set_background_color(state->computed, 32 | CSS_BACKGROUND_COLOR_COLOR, 0); 33 | } 34 | 35 | css_error css__compose_background_color(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_color color; 40 | uint8_t type = get_background_color(child, &color); 41 | 42 | if (type == CSS_BACKGROUND_COLOR_INHERIT) { 43 | type = get_background_color(parent, &color); 44 | } 45 | 46 | return set_background_color(result, type, color); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_bottom_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_bottom_color(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_bg_border_color(opv, style, state, 21 | set_border_bottom_color); 22 | } 23 | 24 | css_error css__set_border_bottom_color_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_border_bottom_color(style, hint->status, hint->data.color); 28 | } 29 | 30 | css_error css__initial_border_bottom_color(css_select_state *state) 31 | { 32 | return set_border_bottom_color(state->computed, 33 | CSS_BORDER_COLOR_CURRENT_COLOR, 0); 34 | } 35 | 36 | css_error css__compose_border_bottom_color(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_color color; 41 | uint8_t type = get_border_bottom_color(child, &color); 42 | 43 | if (type == CSS_BORDER_COLOR_INHERIT) { 44 | type = get_border_bottom_color(parent, &color); 45 | } 46 | 47 | return set_border_bottom_color(result, type, color); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_bottom_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_bottom_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, set_border_bottom_style); 21 | } 22 | 23 | css_error css__set_border_bottom_style_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_bottom_style(style, hint->status); 27 | } 28 | 29 | css_error css__initial_border_bottom_style(css_select_state *state) 30 | { 31 | return set_border_bottom_style(state->computed, CSS_BORDER_STYLE_NONE); 32 | } 33 | 34 | css_error css__compose_border_bottom_style(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | uint8_t type = get_border_bottom_style(child); 39 | 40 | if (type == CSS_BORDER_STYLE_INHERIT) { 41 | type = get_border_bottom_style(parent); 42 | } 43 | 44 | return set_border_bottom_style(result, type); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_left_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_left_color(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_bg_border_color(opv, style, state, 21 | set_border_left_color); 22 | } 23 | 24 | css_error css__set_border_left_color_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_border_left_color(style, hint->status, hint->data.color); 28 | } 29 | 30 | css_error css__initial_border_left_color(css_select_state *state) 31 | { 32 | return set_border_left_color(state->computed, 33 | CSS_BORDER_COLOR_CURRENT_COLOR, 0); 34 | } 35 | 36 | css_error css__compose_border_left_color(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_color color; 41 | uint8_t type = get_border_left_color(child, &color); 42 | 43 | if (type == CSS_BORDER_COLOR_INHERIT) { 44 | type = get_border_left_color(parent, &color); 45 | } 46 | 47 | return set_border_left_color(result, type, color); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_left_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_left_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, set_border_left_style); 21 | } 22 | 23 | css_error css__set_border_left_style_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_left_style(style, hint->status); 27 | } 28 | 29 | css_error css__initial_border_left_style(css_select_state *state) 30 | { 31 | return set_border_left_style(state->computed, CSS_BORDER_STYLE_NONE); 32 | } 33 | 34 | css_error css__compose_border_left_style(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | uint8_t type = get_border_left_style(child); 39 | 40 | if (type == CSS_BORDER_STYLE_INHERIT) { 41 | type = get_border_left_style(parent); 42 | } 43 | 44 | return set_border_left_style(result, type); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_right_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_right_color(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_bg_border_color(opv, style, state, 21 | set_border_right_color); 22 | } 23 | 24 | css_error css__set_border_right_color_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_border_right_color(style, hint->status, hint->data.color); 28 | } 29 | 30 | css_error css__initial_border_right_color(css_select_state *state) 31 | { 32 | return set_border_right_color(state->computed, 33 | CSS_BORDER_COLOR_CURRENT_COLOR, 0); 34 | } 35 | 36 | css_error css__compose_border_right_color(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_color color; 41 | uint8_t type = get_border_right_color(child, &color); 42 | 43 | if (type == CSS_BORDER_COLOR_INHERIT) { 44 | type = get_border_right_color(parent, &color); 45 | } 46 | 47 | return set_border_right_color(result, type, color); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_right_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_right_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, set_border_right_style); 21 | } 22 | 23 | css_error css__set_border_right_style_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_right_style(style, hint->status); 27 | } 28 | 29 | css_error css__initial_border_right_style(css_select_state *state) 30 | { 31 | return set_border_right_style(state->computed, CSS_BORDER_STYLE_NONE); 32 | } 33 | 34 | css_error css__compose_border_right_style(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | uint8_t type = get_border_right_style(child); 39 | 40 | if (type == CSS_BORDER_STYLE_INHERIT) { 41 | type = get_border_right_style(parent); 42 | } 43 | 44 | return set_border_right_style(result, type); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_top_color.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_top_color(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_bg_border_color(opv, style, state, set_border_top_color); 21 | } 22 | 23 | css_error css__set_border_top_color_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_top_color(style, hint->status, hint->data.color); 27 | } 28 | 29 | css_error css__initial_border_top_color(css_select_state *state) 30 | { 31 | return set_border_top_color(state->computed, CSS_BORDER_COLOR_CURRENT_COLOR, 0); 32 | } 33 | 34 | css_error css__compose_border_top_color(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | css_color color; 39 | uint8_t type = get_border_top_color(child, &color); 40 | 41 | if (type == CSS_BORDER_COLOR_INHERIT) { 42 | type = get_border_top_color(parent, &color); 43 | } 44 | 45 | return set_border_top_color(result, type, color); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_top_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_top_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, set_border_top_style); 21 | } 22 | 23 | css_error css__set_border_top_style_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_top_style(style, hint->status); 27 | } 28 | 29 | css_error css__initial_border_top_style(css_select_state *state) 30 | { 31 | return set_border_top_style(state->computed, CSS_BORDER_STYLE_NONE); 32 | } 33 | 34 | css_error css__compose_border_top_style(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | uint8_t type = get_border_top_style(child); 39 | 40 | if (type == CSS_BORDER_STYLE_INHERIT) { 41 | type = get_border_top_style(parent); 42 | } 43 | 44 | return set_border_top_style(result, type); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/border_top_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_border_top_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_width(opv, style, state, set_border_top_width); 21 | } 22 | 23 | css_error css__set_border_top_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_border_top_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_border_top_width(css_select_state *state) 31 | { 32 | return set_border_top_width(state->computed, CSS_BORDER_WIDTH_MEDIUM, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_border_top_width(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_border_top_width(child, &length, &unit); 43 | 44 | if (type == CSS_BORDER_WIDTH_INHERIT) { 45 | type = get_border_top_width(parent, &length, &unit); 46 | } 47 | 48 | return set_border_top_width(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_bottom(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_bottom); 21 | } 22 | 23 | css_error css__set_bottom_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_bottom(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_bottom(css_select_state *state) 31 | { 32 | return set_bottom(state->computed, CSS_BOTTOM_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_bottom(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_bottom(child, &length, &unit); 42 | 43 | if (type == CSS_BOTTOM_INHERIT) { 44 | type = get_bottom(parent, &length, &unit); 45 | } 46 | 47 | return set_bottom(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/break_after.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2012 Michael Drake 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_break_after(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_break_after_before_inside(opv, style, state, 21 | set_break_after); 22 | } 23 | 24 | css_error css__set_break_after_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_break_after(style, hint->status); 28 | } 29 | 30 | css_error css__initial_break_after(css_select_state *state) 31 | { 32 | return set_break_after(state->computed, CSS_BREAK_AFTER_AUTO); 33 | } 34 | 35 | css_error css__compose_break_after(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | uint8_t type = get_break_after(child); 40 | 41 | if (type == CSS_BREAK_AFTER_INHERIT) { 42 | type = get_break_after(parent); 43 | } 44 | 45 | return set_break_after(result, type); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/break_before.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2012 Michael Drake 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_break_before(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_break_after_before_inside(opv, style, state, 21 | set_break_before); 22 | } 23 | 24 | css_error css__set_break_before_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_break_before(style, hint->status); 28 | } 29 | 30 | css_error css__initial_break_before(css_select_state *state) 31 | { 32 | return set_break_before(state->computed, CSS_BREAK_BEFORE_AUTO); 33 | } 34 | 35 | css_error css__compose_break_before(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | uint8_t type = get_break_before(child); 40 | 41 | if (type == CSS_BREAK_BEFORE_INHERIT) { 42 | type = get_break_before(parent); 43 | } 44 | 45 | return set_break_before(result, type); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/column_gap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2012 Michael Drake 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_column_gap(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_normal(opv, style, state, set_column_gap); 21 | } 22 | 23 | css_error css__set_column_gap_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_column_gap(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_column_gap(css_select_state *state) 31 | { 32 | return set_column_gap(state->computed, CSS_COLUMN_GAP_NORMAL, 33 | INTTOFIX(1), CSS_UNIT_EM); 34 | } 35 | 36 | css_error css__compose_column_gap(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = INTTOFIX(1); 41 | css_unit unit = CSS_UNIT_EM; 42 | uint8_t type = get_column_gap(child, &length, &unit); 43 | 44 | if (type == CSS_COLUMN_GAP_INHERIT) { 45 | type = get_column_gap(parent, &length, &unit); 46 | } 47 | 48 | return set_column_gap(result, type, length, unit); 49 | } 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/column_rule_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2012 Michael Drake 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_column_rule_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, 21 | set_column_rule_style); 22 | } 23 | 24 | css_error css__set_column_rule_style_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_column_rule_style(style, hint->status); 28 | } 29 | 30 | css_error css__initial_column_rule_style(css_select_state *state) 31 | { 32 | return set_column_rule_style(state->computed, 33 | CSS_COLUMN_RULE_STYLE_NONE); 34 | } 35 | 36 | css_error css__compose_column_rule_style(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | uint8_t type = get_column_rule_style(child); 41 | 42 | if (type == CSS_COLUMN_RULE_STYLE_INHERIT) { 43 | type = get_column_rule_style(parent); 44 | } 45 | 46 | return set_column_rule_style(result, type); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/column_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2012 Michael Drake 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_column_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_normal(opv, style, state, set_column_width); 21 | } 22 | 23 | css_error css__set_column_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_column_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_column_width(css_select_state *state) 31 | { 32 | return set_column_width(state->computed, CSS_COLUMN_WIDTH_AUTO, 33 | INTTOFIX(1), CSS_UNIT_EM); 34 | } 35 | 36 | css_error css__compose_column_width(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = INTTOFIX(1); 41 | css_unit unit = CSS_UNIT_EM; 42 | uint8_t type = get_column_width(child, &length, &unit); 43 | 44 | if (type == CSS_COLUMN_WIDTH_INHERIT) { 45 | type = get_column_width(parent, &length, &unit); 46 | } 47 | 48 | return set_column_width(result, type, length, unit); 49 | } 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/cue_after.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_cue_after(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo cue-after */ 21 | return css__cascade_uri_none(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_cue_after_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_cue_after(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_cue_after(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/cue_before.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_cue_before(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo cue-before */ 21 | return css__cascade_uri_none(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_cue_before_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_cue_before(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_cue_before(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/height.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_height(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_height); 21 | } 22 | 23 | css_error css__set_height_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_height(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_height(css_select_state *state) 31 | { 32 | return set_height(state->computed, CSS_HEIGHT_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_height(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_height(child, &length, &unit); 42 | 43 | if (type == CSS_HEIGHT_INHERIT) { 44 | type = get_height(parent, &length, &unit); 45 | } 46 | 47 | return set_height(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_left(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_left); 21 | } 22 | 23 | css_error css__set_left_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_left(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_left(css_select_state *state) 31 | { 32 | return set_left(state->computed, CSS_LEFT_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_left(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_left(child, &length, &unit); 42 | 43 | if (type == CSS_LEFT_INHERIT) { 44 | type = get_left(parent, &length, &unit); 45 | } 46 | 47 | return set_left(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/letter_spacing.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_letter_spacing(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_normal(opv, style, state, set_letter_spacing); 21 | } 22 | 23 | css_error css__set_letter_spacing_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_letter_spacing(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_letter_spacing(css_select_state *state) 31 | { 32 | return set_letter_spacing(state->computed, CSS_LETTER_SPACING_NORMAL, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_letter_spacing(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_letter_spacing(child, &length, &unit); 43 | 44 | if (type == CSS_LETTER_SPACING_INHERIT) { 45 | type = get_letter_spacing(parent, &length, &unit); 46 | } 47 | 48 | return set_letter_spacing(result, type, length, unit); 49 | } 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/margin_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_margin_bottom(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_margin_bottom); 21 | } 22 | 23 | css_error css__set_margin_bottom_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_margin_bottom(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_margin_bottom(css_select_state *state) 31 | { 32 | return set_margin_bottom(state->computed, CSS_MARGIN_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_margin_bottom(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_margin_bottom(child, &length, &unit); 42 | 43 | if (type == CSS_MARGIN_INHERIT) { 44 | type = get_margin_bottom(parent, &length, &unit); 45 | } 46 | 47 | return set_margin_bottom(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/margin_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_margin_left(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_margin_left); 21 | } 22 | 23 | css_error css__set_margin_left_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_margin_left(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_margin_left(css_select_state *state) 31 | { 32 | return set_margin_left(state->computed, CSS_MARGIN_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_margin_left(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_margin_left(child, &length, &unit); 42 | 43 | if (type == CSS_MARGIN_INHERIT) { 44 | type = get_margin_left(parent, &length, &unit); 45 | } 46 | 47 | return set_margin_left(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/margin_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_margin_right(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_margin_right); 21 | } 22 | 23 | css_error css__set_margin_right_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_margin_right(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_margin_right(css_select_state *state) 31 | { 32 | return set_margin_right(state->computed, CSS_MARGIN_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_margin_right(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_margin_right(child, &length, &unit); 42 | 43 | if (type == CSS_MARGIN_INHERIT) { 44 | type = get_margin_right(parent, &length, &unit); 45 | } 46 | 47 | return set_margin_right(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/margin_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_margin_top(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_margin_top); 21 | } 22 | 23 | css_error css__set_margin_top_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_margin_top(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_margin_top(css_select_state *state) 31 | { 32 | return set_margin_top(state->computed, CSS_MARGIN_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_margin_top(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_margin_top(child, &length, &unit); 42 | 43 | if (type == CSS_MARGIN_INHERIT) { 44 | type = get_margin_top(parent, &length, &unit); 45 | } 46 | 47 | return set_margin_top(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/max_height.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_max_height(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_none(opv, style, state, set_max_height); 21 | } 22 | 23 | css_error css__set_max_height_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_max_height(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_max_height(css_select_state *state) 31 | { 32 | return set_max_height(state->computed, CSS_MAX_HEIGHT_NONE, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_max_height(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_max_height(child, &length, &unit); 43 | 44 | if (type == CSS_MAX_HEIGHT_INHERIT) { 45 | type = get_max_height(parent, &length, &unit); 46 | } 47 | 48 | return set_max_height(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/max_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_max_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_none(opv, style, state, set_max_width);; 21 | } 22 | 23 | css_error css__set_max_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_max_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_max_width(css_select_state *state) 31 | { 32 | return set_max_width(state->computed, CSS_MAX_WIDTH_NONE, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_max_width(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_max_width(child, &length, &unit); 42 | 43 | if (type == CSS_MAX_WIDTH_INHERIT) { 44 | type = get_max_width(parent, &length, &unit); 45 | } 46 | 47 | return set_max_width(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/min_height.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_min_height(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_min_height); 21 | } 22 | 23 | css_error css__set_min_height_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_min_height(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_min_height(css_select_state *state) 31 | { 32 | return set_min_height(state->computed, CSS_MIN_HEIGHT_AUTO, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_min_height(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_min_height(child, &length, &unit); 43 | 44 | if (type == CSS_MIN_HEIGHT_INHERIT) { 45 | type = get_min_height(parent, &length, &unit); 46 | } 47 | 48 | return set_min_height(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/min_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_min_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_min_width); 21 | } 22 | 23 | css_error css__set_min_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_min_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_min_width(css_select_state *state) 31 | { 32 | return set_min_width(state->computed, CSS_MIN_WIDTH_AUTO, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_min_width(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_min_width(child, &length, &unit); 43 | 44 | if (type == CSS_MIN_WIDTH_INHERIT) { 45 | type = get_min_width(parent, &length, &unit); 46 | } 47 | 48 | return set_min_width(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/orphans.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_orphans(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_number(opv, style, state, set_orphans); 21 | } 22 | 23 | css_error css__set_orphans_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_orphans(style, hint->status, hint->data.integer); 27 | } 28 | 29 | css_error css__initial_orphans(css_select_state *state) 30 | { 31 | return set_orphans(state->computed, CSS_ORPHANS_SET, 2); 32 | } 33 | 34 | css_error css__compose_orphans(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | int32_t count = 0; 39 | uint8_t type = get_orphans(child, &count); 40 | 41 | if (type == CSS_ORPHANS_INHERIT) { 42 | type = get_orphans(parent, &count); 43 | } 44 | 45 | return set_orphans(result, type, count); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/outline_style.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_outline_style(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_style(opv, style, state, set_outline_style); 21 | } 22 | 23 | css_error css__set_outline_style_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_outline_style(style, hint->status); 27 | } 28 | 29 | css_error css__initial_outline_style(css_select_state *state) 30 | { 31 | return set_outline_style(state->computed, CSS_OUTLINE_STYLE_NONE); 32 | } 33 | 34 | css_error css__compose_outline_style(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | uint8_t type = get_outline_style(child); 39 | 40 | if (type == CSS_OUTLINE_STYLE_INHERIT) { 41 | type = get_outline_style(parent); 42 | } 43 | 44 | return set_outline_style(result, type); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/outline_width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_outline_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_border_width(opv, style, state, set_outline_width); 21 | } 22 | 23 | css_error css__set_outline_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_outline_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_outline_width(css_select_state *state) 31 | { 32 | return set_outline_width(state->computed, CSS_OUTLINE_WIDTH_MEDIUM, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_outline_width(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_outline_width(child, &length, &unit); 43 | 44 | if (type == CSS_OUTLINE_WIDTH_INHERIT) { 45 | type = get_outline_width(parent, &length, &unit); 46 | } 47 | 48 | return set_outline_width(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/padding_bottom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_padding_bottom(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length(opv, style, state, set_padding_bottom); 21 | } 22 | 23 | css_error css__set_padding_bottom_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_padding_bottom(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_padding_bottom(css_select_state *state) 31 | { 32 | return set_padding_bottom(state->computed, CSS_PADDING_SET, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_padding_bottom(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_padding_bottom(child, &length, &unit); 43 | 44 | if (type == CSS_PADDING_INHERIT) { 45 | type = get_padding_bottom(parent, &length, &unit); 46 | } 47 | 48 | return set_padding_bottom(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/padding_left.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_padding_left(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length(opv, style, state, set_padding_left); 21 | } 22 | 23 | css_error css__set_padding_left_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_padding_left(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_padding_left(css_select_state *state) 31 | { 32 | return set_padding_left(state->computed, CSS_PADDING_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_padding_left(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_padding_left(child, &length, &unit); 42 | 43 | if (type == CSS_PADDING_INHERIT) { 44 | type = get_padding_left(parent, &length, &unit); 45 | } 46 | 47 | return set_padding_left(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/padding_right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_padding_right(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length(opv, style, state, set_padding_right); 21 | } 22 | 23 | css_error css__set_padding_right_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_padding_right(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_padding_right(css_select_state *state) 31 | { 32 | return set_padding_right(state->computed, CSS_PADDING_SET, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_padding_right(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_padding_right(child, &length, &unit); 43 | 44 | if (type == CSS_PADDING_INHERIT) { 45 | type = get_padding_right(parent, &length, &unit); 46 | } 47 | 48 | return set_padding_right(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/padding_top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_padding_top(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length(opv, style, state, set_padding_top); 21 | } 22 | 23 | css_error css__set_padding_top_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_padding_top(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_padding_top(css_select_state *state) 31 | { 32 | return set_padding_top(state->computed, CSS_PADDING_SET, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_padding_top(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_padding_top(child, &length, &unit); 42 | 43 | if (type == CSS_PADDING_INHERIT) { 44 | type = get_padding_top(parent, &length, &unit); 45 | } 46 | 47 | return set_padding_top(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/page_break_after.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_page_break_after(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_page_break_after_before_inside(opv, style, state, 21 | set_page_break_after); 22 | } 23 | 24 | css_error css__set_page_break_after_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_page_break_after(style, hint->status); 28 | } 29 | 30 | css_error css__initial_page_break_after(css_select_state *state) 31 | { 32 | return set_page_break_after(state->computed, 33 | CSS_PAGE_BREAK_AFTER_AUTO); 34 | } 35 | 36 | css_error css__compose_page_break_after(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | uint8_t type = get_page_break_after(child); 41 | 42 | if (type == CSS_PAGE_BREAK_AFTER_INHERIT) { 43 | type = get_page_break_after(parent); 44 | } 45 | 46 | return set_page_break_after(result, type); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/page_break_before.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_page_break_before(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_page_break_after_before_inside(opv, style, state, 21 | set_page_break_before); 22 | } 23 | 24 | css_error css__set_page_break_before_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_page_break_before(style, hint->status); 28 | } 29 | 30 | css_error css__initial_page_break_before(css_select_state *state) 31 | { 32 | return set_page_break_before(state->computed, 33 | CSS_PAGE_BREAK_BEFORE_AUTO); 34 | } 35 | 36 | css_error css__compose_page_break_before(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | uint8_t type = get_page_break_before(child); 41 | 42 | if (type == CSS_PAGE_BREAK_BEFORE_INHERIT) { 43 | type = get_page_break_before(parent); 44 | } 45 | 46 | return set_page_break_before(result, type); 47 | } 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/page_break_inside.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_page_break_inside(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_page_break_after_before_inside(opv, style, state, 21 | set_page_break_inside); 22 | } 23 | 24 | css_error css__set_page_break_inside_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | return set_page_break_inside(style, hint->status); 28 | } 29 | 30 | css_error css__initial_page_break_inside(css_select_state *state) 31 | { 32 | return set_page_break_inside(state->computed, 33 | CSS_PAGE_BREAK_INSIDE_AUTO); 34 | } 35 | 36 | css_error css__compose_page_break_inside(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | uint8_t type = get_page_break_inside(child); 41 | 42 | if (type == CSS_PAGE_BREAK_INSIDE_INHERIT) { 43 | type = get_page_break_inside(parent); 44 | } 45 | 46 | return set_page_break_inside(result, type); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/pause_after.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_pause_after(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo pause-after */ 21 | return css__cascade_length(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_pause_after_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_pause_after(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_pause_after(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/pause_before.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_pause_before(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo pause-before */ 21 | return css__cascade_length(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_pause_before_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_pause_before(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_pause_before(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/pitch_range.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_pitch_range(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo pitch-range */ 21 | return css__cascade_number(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_pitch_range_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_pitch_range(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_pitch_range(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/richness.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_richness(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo richness */ 21 | return css__cascade_number(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_richness_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_richness(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_richness(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_right(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_right); 21 | } 22 | 23 | css_error css__set_right_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_right(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_right(css_select_state *state) 31 | { 32 | return set_right(state->computed, CSS_RIGHT_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_right(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_right(child, &length, &unit); 42 | 43 | if (type == CSS_RIGHT_INHERIT) { 44 | type = get_right(parent, &length, &unit); 45 | } 46 | 47 | return set_right(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/speak.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_speak(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | UNUSED(style); 21 | 22 | if (isInherit(opv) == false) { 23 | switch (getValue(opv)) { 24 | case SPEAK_NORMAL: 25 | case SPEAK_NONE: 26 | case SPEAK_SPELL_OUT: 27 | /** \todo convert to public values */ 28 | break; 29 | } 30 | } 31 | 32 | if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, 33 | isInherit(opv))) { 34 | /** \todo speak */ 35 | } 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__set_speak_from_hint(const css_hint *hint, 41 | css_computed_style *style) 42 | { 43 | UNUSED(hint); 44 | UNUSED(style); 45 | 46 | return CSS_OK; 47 | } 48 | 49 | css_error css__initial_speak(css_select_state *state) 50 | { 51 | UNUSED(state); 52 | 53 | return CSS_OK; 54 | } 55 | 56 | css_error css__compose_speak(const css_computed_style *parent, 57 | const css_computed_style *child, 58 | css_computed_style *result) 59 | { 60 | UNUSED(parent); 61 | UNUSED(child); 62 | UNUSED(result); 63 | 64 | return CSS_OK; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/speak_header.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_speak_header(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | UNUSED(style); 21 | 22 | if (isInherit(opv) == false) { 23 | switch (getValue(opv)) { 24 | case SPEAK_HEADER_ONCE: 25 | case SPEAK_HEADER_ALWAYS: 26 | /** \todo convert to public values */ 27 | break; 28 | } 29 | } 30 | 31 | if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, 32 | isInherit(opv))) { 33 | /** \todo speak-header */ 34 | } 35 | 36 | return CSS_OK; 37 | } 38 | 39 | css_error css__set_speak_header_from_hint(const css_hint *hint, 40 | css_computed_style *style) 41 | { 42 | UNUSED(hint); 43 | UNUSED(style); 44 | 45 | return CSS_OK; 46 | } 47 | 48 | css_error css__initial_speak_header(css_select_state *state) 49 | { 50 | UNUSED(state); 51 | 52 | return CSS_OK; 53 | } 54 | 55 | css_error css__compose_speak_header(const css_computed_style *parent, 56 | const css_computed_style *child, 57 | css_computed_style *result) 58 | { 59 | UNUSED(parent); 60 | UNUSED(child); 61 | UNUSED(result); 62 | 63 | return CSS_OK; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/speak_numeral.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_speak_numeral(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | UNUSED(style); 21 | 22 | if (isInherit(opv) == false) { 23 | switch (getValue(opv)) { 24 | case SPEAK_NUMERAL_DIGITS: 25 | case SPEAK_NUMERAL_CONTINUOUS: 26 | /** \todo convert to public values */ 27 | break; 28 | } 29 | } 30 | 31 | if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, 32 | isInherit(opv))) { 33 | /** \todo speak-numeral */ 34 | } 35 | 36 | return CSS_OK; 37 | } 38 | 39 | css_error css__set_speak_numeral_from_hint(const css_hint *hint, 40 | css_computed_style *style) 41 | { 42 | UNUSED(hint); 43 | UNUSED(style); 44 | 45 | return CSS_OK; 46 | } 47 | 48 | css_error css__initial_speak_numeral(css_select_state *state) 49 | { 50 | UNUSED(state); 51 | 52 | return CSS_OK; 53 | } 54 | 55 | css_error css__compose_speak_numeral(const css_computed_style *parent, 56 | const css_computed_style *child, 57 | css_computed_style *result) 58 | { 59 | UNUSED(parent); 60 | UNUSED(child); 61 | UNUSED(result); 62 | 63 | return CSS_OK; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/stress.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_stress(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | /** \todo stress */ 21 | return css__cascade_number(opv, style, state, NULL); 22 | } 23 | 24 | css_error css__set_stress_from_hint(const css_hint *hint, 25 | css_computed_style *style) 26 | { 27 | UNUSED(hint); 28 | UNUSED(style); 29 | 30 | return CSS_OK; 31 | } 32 | 33 | css_error css__initial_stress(css_select_state *state) 34 | { 35 | UNUSED(state); 36 | 37 | return CSS_OK; 38 | } 39 | 40 | css_error css__compose_stress(const css_computed_style *parent, 41 | const css_computed_style *child, 42 | css_computed_style *result) 43 | { 44 | UNUSED(parent); 45 | UNUSED(child); 46 | UNUSED(result); 47 | 48 | return CSS_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/text_indent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_text_indent(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length(opv, style, state, set_text_indent); 21 | } 22 | 23 | css_error css__set_text_indent_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_text_indent(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_text_indent(css_select_state *state) 31 | { 32 | return set_text_indent(state->computed, CSS_TEXT_INDENT_SET, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_text_indent(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_text_indent(child, &length, &unit); 43 | 44 | if (type == CSS_TEXT_INDENT_INHERIT) { 45 | type = get_text_indent(parent, &length, &unit); 46 | } 47 | 48 | return set_text_indent(result, type, length, unit); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/top.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_top(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_top); 21 | } 22 | 23 | css_error css__set_top_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_top(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_top(css_select_state *state) 31 | { 32 | return set_top(state->computed, CSS_TOP_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_top(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_top(child, &length, &unit); 42 | 43 | if (type == CSS_TOP_INHERIT) { 44 | type = get_top(parent, &length, &unit); 45 | } 46 | 47 | return set_top(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/widows.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_widows(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_number(opv, style, state, set_widows); 21 | } 22 | 23 | css_error css__set_widows_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_widows(style, hint->status, hint->data.integer); 27 | } 28 | 29 | css_error css__initial_widows(css_select_state *state) 30 | { 31 | return set_widows(state->computed, CSS_WIDOWS_SET, 2); 32 | } 33 | 34 | css_error css__compose_widows(const css_computed_style *parent, 35 | const css_computed_style *child, 36 | css_computed_style *result) 37 | { 38 | int32_t count = 0; 39 | uint8_t type = get_widows(child, &count); 40 | 41 | if (type == CSS_WIDOWS_INHERIT) { 42 | type = get_widows(parent, &count); 43 | } 44 | 45 | return set_widows(result, type, count); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/width.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_width(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_auto(opv, style, state, set_width); 21 | } 22 | 23 | css_error css__set_width_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_width(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_width(css_select_state *state) 31 | { 32 | return set_width(state->computed, CSS_WIDTH_AUTO, 0, CSS_UNIT_PX); 33 | } 34 | 35 | css_error css__compose_width(const css_computed_style *parent, 36 | const css_computed_style *child, 37 | css_computed_style *result) 38 | { 39 | css_fixed length = 0; 40 | css_unit unit = CSS_UNIT_PX; 41 | uint8_t type = get_width(child, &length, &unit); 42 | 43 | if (type == CSS_WIDTH_INHERIT) { 44 | type = get_width(parent, &length, &unit); 45 | } 46 | 47 | return set_width(result, type, length, unit); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/properties/word_spacing.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #include "bytecode/bytecode.h" 9 | #include "bytecode/opcodes.h" 10 | #include "select/propset.h" 11 | #include "select/propget.h" 12 | #include "utils/utils.h" 13 | 14 | #include "select/properties/properties.h" 15 | #include "select/properties/helpers.h" 16 | 17 | css_error css__cascade_word_spacing(uint32_t opv, css_style *style, 18 | css_select_state *state) 19 | { 20 | return css__cascade_length_normal(opv, style, state, set_word_spacing); 21 | } 22 | 23 | css_error css__set_word_spacing_from_hint(const css_hint *hint, 24 | css_computed_style *style) 25 | { 26 | return set_word_spacing(style, hint->status, 27 | hint->data.length.value, hint->data.length.unit); 28 | } 29 | 30 | css_error css__initial_word_spacing(css_select_state *state) 31 | { 32 | return set_word_spacing(state->computed, CSS_WORD_SPACING_NORMAL, 33 | 0, CSS_UNIT_PX); 34 | } 35 | 36 | css_error css__compose_word_spacing(const css_computed_style *parent, 37 | const css_computed_style *child, 38 | css_computed_style *result) 39 | { 40 | css_fixed length = 0; 41 | css_unit unit = CSS_UNIT_PX; 42 | uint8_t type = get_word_spacing(child, &length, &unit); 43 | 44 | if (type == CSS_WORD_SPACING_INHERIT) { 45 | type = get_word_spacing(parent, &length, &unit); 46 | } 47 | 48 | return set_word_spacing(result, type, length, unit); 49 | } 50 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/propget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_select_propget_h_ 9 | #define css_select_propget_h_ 10 | 11 | #include 12 | #include "computed.h" 13 | #include "autogenerated_propget.h" 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/select/propset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_select_propset_h_ 9 | #define css_select_propset_h_ 10 | 11 | #include 12 | 13 | #include 14 | #include "computed.h" 15 | #include "autogenerated_propset.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/utils/errors.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | 12 | /** 13 | * Convert a LibCSS error code to a string 14 | * 15 | * \param error The error code to convert 16 | * \return Pointer to string representation of error, or NULL if unknown. 17 | */ 18 | const char *css_error_to_string(css_error error) 19 | { 20 | const char *result = NULL; 21 | 22 | switch (error) { 23 | case CSS_OK: 24 | result = "No error"; 25 | break; 26 | case CSS_NOMEM: 27 | result = "Insufficient memory"; 28 | break; 29 | case CSS_BADPARM: 30 | result = "Bad parameter"; 31 | break; 32 | case CSS_INVALID: 33 | result = "Invalid input"; 34 | break; 35 | case CSS_FILENOTFOUND: 36 | result = "File not found"; 37 | break; 38 | case CSS_NEEDDATA: 39 | result = "Insufficient data"; 40 | break; 41 | case CSS_BADCHARSET: 42 | result = "BOM and @charset mismatch"; 43 | break; 44 | case CSS_EOF: 45 | result = "EOF encountered"; 46 | break; 47 | case CSS_IMPORTS_PENDING: 48 | result = "Imports pending"; 49 | break; 50 | case CSS_PROPERTY_NOT_SET: 51 | result = "Property not set"; 52 | break; 53 | } 54 | 55 | return result; 56 | } 57 | -------------------------------------------------------------------------------- /src/third-party/libcss/src/utils/parserutilserror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibCSS. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef css_utils_parserutilserror_h_ 9 | #define css_utils_parserutilserror_h_ 10 | 11 | #include 12 | 13 | #include 14 | 15 | /** 16 | * Convert a ParserUtils error into a LibCSS error 17 | * 18 | * \param error The ParserUtils error to convert 19 | * \return The corresponding LibCSS error 20 | */ 21 | static inline css_error css_error_from_parserutils_error( 22 | parserutils_error error) 23 | { 24 | /* Currently, there's a 1:1 mapping, so we've nothing to do */ 25 | return (css_error) error; 26 | } 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/INDEX: -------------------------------------------------------------------------------- 1 | # Index of testcases 2 | # 3 | # Test Description DataDir 4 | 5 | csdetect Character set detection csdetect 6 | #lex Lexing css 7 | lex-auto Automated lexer tests lex 8 | number Conversion of numbers to fixed point number 9 | #parse Parsing (core syntax) css 10 | #css21 Parsing (CSS2.1 specifics) css 11 | parse-auto Automated parser tests (bytecode) parse 12 | parse2-auto Automated parser tests (om & invalid) parse2 13 | select Automated selection engine tests select 14 | 15 | # Regression tests 16 | 17 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/csdetect/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for charset detection tests 2 | # 3 | # Test Description 4 | 5 | bom.dat UTF Byte Order Mark detection tests 6 | bom-charset.dat BOM + @charset tests 7 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/csdetect/bom-charset.dat: -------------------------------------------------------------------------------- 1 | #data 2 | @charset "UTF-8";html{color:green} 3 | /* starts with utf-8 bom */ 4 | #encoding 5 | utf-8 6 | 7 | #data 8 | @charset "ISO-8859-1";html{color:green} 9 | /* starts with utf-8 bom, so @charset is ignored */ 10 | #encoding 11 | utf-8 12 | 13 | #data 14 | @charset "ISO-8859-2";html{color:green} 15 | #encoding 16 | iso-8859-2 17 | 18 | #data 19 | @charset "IMadeThisUp";html{color:green} 20 | #encoding 21 | utf-8 22 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/csdetect/bom.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libcss/test/data/csdetect/bom.dat -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for generic CSS content 2 | # 3 | # Test Description 4 | 5 | simple.css Reasonably simple CSS file (semantically invalid) 6 | allzengarden.css All CSS Zen Garden stylesheets concatenated 7 | blocks.css Basic blocks and at-rule syntax 8 | malformed.css Malformed declarations from the CSS 2.1 spec 9 | badcomment.css Comment inside { ... } lacks starting /* 10 | fontface.css Various @font-face rules -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/allzengarden.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libcss/test/data/css/allzengarden.css -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/badcomment.css: -------------------------------------------------------------------------------- 1 | .icon-app-medium, 2 | .icon-archive-medium, 3 | .icon-document-medium, 4 | .icon-folder-medium, 5 | .icon-folder-apps-medium, 6 | .icon-folder-download-medium, 7 | .icon-folder-dev-medium, 8 | .icon-folder-haiku-medium, 9 | .icon-folder-mail-medium, 10 | .icon-folder-people-medium, 11 | .icon-folder-search-medium, 12 | .icon-hdd-medium, 13 | .icon-html-medium, 14 | .icon-ide-project-medium, 15 | .icon-news-medium, 16 | .icon-pdf-medium, 17 | .icon-video-medium, 18 | .icon-people-medium, 19 | .icon-person-medium, 20 | .icon-screen-medium, 21 | .icon-styled-edit-medium, 22 | .icon-terminal-medium, 23 | .icon-vmware-medium 24 | { 25 | background-repeat: no-repeat; 26 | list-style: none !important; 27 | padding-left: 36px; 28 | padding-top: 10px; Increased from 15 to 20 to avoid icon chop off */ 29 | line-height: 150% !important; 30 | list-style-image: none !important; 31 | } 32 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/blocks.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "simple.css"; 4 | 5 | @foo rgb(255,255,255); 6 | 7 | @bar (a,b,c); 8 | 9 | @media screen 10 | { 11 | body 12 | { 13 | background-color: green; 14 | color: yellow; 15 | background-image: url("foo"); 16 | color: [ ( { ] ) }; 17 | } 18 | 19 | @page :left 20 | { 21 | @margin { 10mm, 20mm, 30mm, 40mm }; 22 | margin-top: 50mm; 23 | } 24 | 25 | div 26 | { 27 | color: blue; 28 | } 29 | 30 | border-left: 10mm 31 | } 32 | 33 | @page 34 | { 35 | margin-left: 50mm; 36 | } 37 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/color.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | color: #12f; 4 | color: #12345f; 5 | color: rgb(0, 0, 0); 6 | color: rgb(0%, 0%, 0%); 7 | 8 | color: rgb(300, 0, 0); 9 | color: rgb(-10, 0, 0); 10 | color: rgb(150%, 0%, 0%); 11 | color: rgb(-10%, 0%, 0%); 12 | 13 | color: 123; 14 | color: 123456; 15 | color: 12f; 16 | color: 12345f; 17 | color: 12f456; 18 | color: f00000; 19 | } 20 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/malformed.css: -------------------------------------------------------------------------------- 1 | p { color:green } 2 | p { color:green; color } /* malformed declaration missing ':', value */ 3 | p { color:red; color; color:green } /* same with expected recovery */ 4 | p { color:green; color: } /* malformed declaration missing value */ 5 | p { color:red; color:; color:green } /* same with expected recovery */ 6 | p { color:green; color{;color:maroon} } /* unexpected tokens { } */ 7 | p { color:red; color{;color:maroon}; color:green } /* same with recovery */ 8 | p { color:red; !important; color:green } 9 | 10 | @blah { moose } 12 | 13 | "Foo bar baz 14 | p ( { ) color: green } ) 15 | p {color:green} 16 | 17 | p { color: green; } 18 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/css/simple.css: -------------------------------------------------------------------------------- 1 | 3 | url(foo); 4 | "foo)"; 5 | "foo'"; 6 | 'foo"'; 7 | "foo\""; 8 | 'foo\''; 9 | url("foo)"); 10 | url("foo'"); 11 | url('foo"'); 12 | url("foo\""); 13 | url('foo\''); 14 | .blah 15 | #foo 16 | /********/ 17 | html { 18 | color: green; 19 | } 20 | U+2022-2023 21 | U+??33-40fa 22 | U+x 23 | U+01234599 24 | U+??????-000012f 25 | 0.575 26 | .825 27 | 15 28 | 20% 29 | .05% 30 | 0.1% 31 | 0.% 32 | 5em 33 | .5em 34 | 0.4px 35 | .% 36 | \.moo\se {} 37 | bla\2022 f {} 38 | @import url('foo.css'); 39 | @\hello; 40 | @.bad {} 41 | body { font-family: "Bitstream Vera Sans"; } 42 | body { font-family: "foo \ 43 | bar"; } 44 | /** 45 | */ 46 | body { font-family: "unterminated string 47 | foo } 48 | 49 | blah { baz: bat; foo: bar !important; } 50 | 51 | foo { bar: ""; }{ color: green; } 52 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/lex/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for automated lexer tests 2 | # 3 | # Test Description 4 | 5 | tests1.dat Basic tests 6 | tests2.dat More complicated tests 7 | regression.dat Regression tests 8 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/lex/regression.dat: -------------------------------------------------------------------------------- 1 | #data 2 | -1 3 | #expected 4 | NUMBER:-1 5 | S 6 | EOF 7 | #reset 8 | 9 | #data 10 | +1 11 | #expected 12 | NUMBER:+1 13 | S 14 | EOF 15 | #reset 16 | 17 | #data 18 | -1.0 19 | #expected 20 | NUMBER:-1.0 21 | S 22 | EOF 23 | #reset 24 | 25 | #data 26 | +1.0 27 | #expected 28 | NUMBER:+1.0 29 | S 30 | EOF 31 | #reset 32 | 33 | #data 34 | -.5 35 | #expected 36 | NUMBER:-.5 37 | S 38 | EOF 39 | #reset 40 | 41 | #data 42 | +.5 43 | #expected 44 | NUMBER:+.5 45 | S 46 | EOF 47 | #reset 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/number/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for generic CSS content 2 | # 3 | # Test Description 4 | 5 | number.dat Number tests 6 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for automated parser tests 2 | # 3 | # Test Description 4 | 5 | tests1.dat Basic tests 6 | selectors.dat Selectors 7 | atrules.dat @-rules 8 | colours.dat Colour values 9 | colours-hsl.dat HSL Colour values 10 | nth.dat :nth-* expressions 11 | properties.dat Properties 12 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/README: -------------------------------------------------------------------------------- 1 | Parser testcases 2 | ================ 3 | 4 | Format 5 | ------ 6 | 7 | #data 8 | 9 | #errors 10 | (ignored at present) 11 | #expected 12 | 13 | #reset 14 | 15 | Format of rule list 16 | ------------------- 17 | 18 | line ::= rule | bytecode 19 | rule ::= '| ' type ' '+ name 20 | name ::= .+ 21 | type ::= [0-9]+ 22 | bytecode ::= '| ' ' '* hexnum (' '+ (hexnum | ptr))* 23 | hexnum ::= '0x' [0-9a-fA-F]+ 24 | ptr ::= 'PTR(' .* ')' 25 | 26 | Type corresponds to css_rule_type. Consult the library sources for the values. 27 | 28 | Bytecode may be split over multiple lines for readability. All bytecode is 29 | associated with the most-recently-declared rule. Consult the bytecode 30 | documentation for what the hexnums should be representing. 31 | 32 | Example 33 | ------- 34 | 35 | #data 36 | * { color: #ff0000; background-image: url("foo.png"); } 37 | #errors 38 | #expected 39 | | 1 * 40 | | 0x0200000f 0xff000000 41 | | 0x02000003 PTR(foo.png) 42 | #reset 43 | 44 | TODO 45 | ---- 46 | 47 | + Permit nesting of rules (for nested block support) 48 | 49 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/atrules.dat: -------------------------------------------------------------------------------- 1 | ## Basic @-rules 2 | 3 | #data 4 | @charset "UTF-8"; 5 | #errors 6 | #expected 7 | | 2 UTF-8 8 | #reset 9 | 10 | #data 11 | @import "foo.css"; 12 | #errors 13 | #expected 14 | | 3 foo.css 15 | #reset 16 | 17 | #data 18 | @import url("bar.css"); 19 | #errors 20 | #expected 21 | | 3 bar.css 22 | #reset 23 | 24 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/makefixed.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use warnings; 4 | use strict; 5 | 6 | die "Usage: makefixed.pl \n" if (@ARGV != 1); 7 | 8 | my $val = shift @ARGV; 9 | 10 | $val *= (1 << 10); 11 | 12 | # Round away from zero 13 | if ($val < 0) { 14 | $val -= 0.5; 15 | } else { 16 | $val += 0.5; 17 | } 18 | 19 | # Truncates back towards zero 20 | printf("0x%.8x\n", $val); 21 | 22 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/makeopv.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use warnings; 4 | use strict; 5 | 6 | die "Usage: makeopv.pl \n" if (@ARGV != 3); 7 | 8 | my ($opcode, $flags, $value) = @ARGV; 9 | 10 | printf("0x%.8x\n", oct($opcode) | oct($flags) << 10 | oct($value) << 18); 11 | 12 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse/tests1.dat: -------------------------------------------------------------------------------- 1 | #data 2 | * { } 3 | #errors 4 | #expected 5 | | 1 * 6 | #reset 7 | 8 | #data 9 | * { color: #ff0000 } 10 | #errors 11 | #expected 12 | | 1 * 13 | | 0x02000018 0xffff0000 14 | #reset 15 | 16 | #data 17 | * { color: inherit } 18 | #errors 19 | #expected 20 | | 1 * 21 | | 0x00000818 22 | #reset 23 | 24 | #data 25 | * { color: inherit ! important } 26 | #errors 27 | #expected 28 | | 1 * 29 | | 0x00000c18 30 | #reset 31 | 32 | #data 33 | * { color: inherit !important } 34 | #errors 35 | #expected 36 | | 1 * 37 | | 0x00000c18 38 | #reset 39 | 40 | #data 41 | * { background-image: url("foo.png"); color: inherit } 42 | #errors 43 | #expected 44 | | 1 * 45 | | 0x02000003 PTR(foo.png) 0x00000818 46 | #reset 47 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for automated parser tests 2 | # 3 | # Test Description 4 | 5 | tests1.dat Basic tests 6 | eof.dat Unexpected EOF tests 7 | comments.dat Comment tests 8 | selectors.dat Invalid selector tests 9 | illegal-values.dat Illegal value tests 10 | malformed-declarations.dat Malformed declaration tests 11 | unknown-properties.dat Unknown property tests 12 | bgpos.dat Illegal background-position values 13 | au.dat Aural property tests 14 | bg.dat Background property tests 15 | border.dat Border property tests 16 | font.dat Font property tests 17 | list.dat List property tests 18 | margin.dat Margin property tests 19 | outline.dat Outline property tests 20 | overflow.dat Overflow property tests 21 | padding.dat Padding property tests 22 | multicol.dat Multi-column layout property tests 23 | flexbox.dat Flexbox properties and shorthands tests 24 | units.dat Length unit tests 25 | dodgy-media-block.dat Media block with incomplete ruleset 26 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/README: -------------------------------------------------------------------------------- 1 | Parser testcases 2 | ================ 3 | 4 | Format 5 | ------ 6 | 7 | #data 8 | 9 | #errors 10 | (ignored at present) 11 | #expected 12 | 13 | #reset 14 | 15 | Format of cssom tree 16 | -------------------- 17 | 18 | line ::= rule | declaration 19 | rule ::= '| ' name 20 | name ::= .+ 21 | declaration ::= '| ' property-name ': ' property-value 22 | 23 | Example 24 | ------- 25 | 26 | #data 27 | * { color: #ff0000; background-image: url("foo.png"); } 28 | #errors 29 | #expected 30 | | * 31 | | color: #ff000000 32 | | background-image: url("foo.png") 33 | #reset 34 | 35 | TODO 36 | ---- 37 | 38 | + Permit nesting of rules (for nested block support) 39 | 40 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/bgpos.dat: -------------------------------------------------------------------------------- 1 | #data 2 | * { background-position: left left; } 3 | #errors 4 | #expected 5 | | * 6 | #reset 7 | 8 | #data 9 | * { background-position: bottom 20%; } 10 | #errors 11 | #expected 12 | | * 13 | #reset 14 | 15 | #data 16 | * { background-position: right foo; } 17 | #errors 18 | #expected 19 | | * 20 | #reset 21 | 22 | #data 23 | * { background-position: left top inherit; } 24 | #errors 25 | #expected 26 | | * 27 | #reset 28 | 29 | #data 30 | * { background-position: inherit left top; } 31 | #errors 32 | #expected 33 | | * 34 | #reset 35 | 36 | #data 37 | * { background-position: left top; } 38 | #errors 39 | #expected 40 | | * 41 | | background-position: left top 42 | #reset 43 | 44 | #data 45 | * { background-position: left center; } 46 | #errors 47 | #expected 48 | | * 49 | | background-position: left center 50 | #reset 51 | 52 | #data 53 | * { background-position: 62% center; } 54 | #errors 55 | #expected 56 | | * 57 | | background-position: 62% center 58 | #reset 59 | 60 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/comments.dat: -------------------------------------------------------------------------------- 1 | #data 2 | /**/* /* 2 *//*3*/ {/*4*/ background-attachment:/*5*/ fixed/**/;/*7*/ } 3 | #errors 4 | #expected 5 | | * 6 | | background-attachment: fixed 7 | #reset 8 | 9 | #data 10 | /**/* /* } *//*3*/ {/*;*/ background-attachment/* display: */:/*6}*/ scroll/**/;/*8*/ } 11 | #errors 12 | #expected 13 | | * 14 | | background-attachment: scroll 15 | #reset 16 | 17 | #data 18 | /**/* /* 2 *//*3*/ {/*4*/ background-attachment:/*5*/ fixed/**/;/*7*/ speech-rate: /*/*//*/**/ medium; } 19 | #errors 20 | #expected 21 | | * 22 | | background-attachment: fixed 23 | | speech-rate: medium 24 | #reset 25 | 26 | #data 27 | * {/* stress:100; } 28 | #errors 29 | #expected 30 | | * 31 | #reset 32 | 33 | #data 34 | * /*{ stress:100; } 35 | #errors 36 | #expected 37 | #reset 38 | 39 | #data 40 | */* { stress:100; } 41 | #errors 42 | #expected 43 | #reset 44 | 45 | #data 46 | * { stress:/*100; } 47 | #errors 48 | #expected 49 | | * 50 | #reset 51 | 52 | #data 53 | * { stress:100/*; } 54 | #errors 55 | #expected 56 | | * 57 | | stress: 100 58 | #reset 59 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/dodgy-media-block.dat: -------------------------------------------------------------------------------- 1 | #data 2 | @media only screen { dodgy } .outer { top: 0px } 3 | #errors 4 | #expected 5 | | @media 6 | | dodgy 7 | | .outer 8 | | top: 0px 9 | #reset 10 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/illegal-values.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libcss/test/data/parse2/illegal-values.dat -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/overflow.dat: -------------------------------------------------------------------------------- 1 | #data 2 | * { overflow: auto; } 3 | #errors 4 | #expected 5 | | * 6 | | overflow-x: auto 7 | | overflow-y: auto 8 | #reset 9 | 10 | #data 11 | * { overflow: hidden; } 12 | #errors 13 | #expected 14 | | * 15 | | overflow-x: hidden 16 | | overflow-y: hidden 17 | #reset 18 | 19 | #data 20 | * { overflow: visible; } 21 | #errors 22 | #expected 23 | | * 24 | | overflow-x: visible 25 | | overflow-y: visible 26 | #reset 27 | 28 | #data 29 | * { overflow: scroll; } 30 | #errors 31 | #expected 32 | | * 33 | | overflow-x: scroll 34 | | overflow-y: scroll 35 | #reset 36 | 37 | #data 38 | * { overflow: inherit; } 39 | #errors 40 | #expected 41 | | * 42 | | overflow-x: inherit 43 | | overflow-y: inherit 44 | #reset 45 | 46 | #data 47 | * { overflow-x: inherit; } 48 | #errors 49 | #expected 50 | | * 51 | | overflow-x: inherit 52 | #reset 53 | 54 | #data 55 | * { overflow-x: scroll; } 56 | #errors 57 | #expected 58 | | * 59 | | overflow-x: scroll 60 | #reset 61 | 62 | #data 63 | * { overflow-y: visible; } 64 | #errors 65 | #expected 66 | | * 67 | | overflow-y: visible 68 | #reset 69 | 70 | #data 71 | * { overflow-y: auto; } 72 | #errors 73 | #expected 74 | | * 75 | | overflow-y: auto 76 | #reset 77 | 78 | #data 79 | * { overflow-x: visible; overflow-y: hidden; } 80 | #errors 81 | #expected 82 | | * 83 | | overflow-x: visible 84 | | overflow-y: hidden 85 | #reset 86 | 87 | #data 88 | * { overflow-y: auto; overflow-x: inherit; } 89 | #errors 90 | #expected 91 | | * 92 | | overflow-y: auto 93 | | overflow-x: inherit 94 | #reset 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/selectors.dat: -------------------------------------------------------------------------------- 1 | ## Unknown combinator 2 | 3 | #data 4 | E & F {} 5 | #errors 6 | #expected 7 | #reset 8 | 9 | ## Unknown pseudo 10 | 11 | #data 12 | E:foobar {} 13 | #errors 14 | #expected 15 | #reset 16 | 17 | ## Pseudo element in non-terminal simple selector 18 | 19 | #data 20 | E:first-letter > B {} 21 | #errors 22 | #expected 23 | #reset 24 | 25 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/parse2/unknown-properties.dat: -------------------------------------------------------------------------------- 1 | #data 2 | * { dentist: "Mr Peg"; } 3 | #errors 4 | #expected 5 | | * 6 | #reset 7 | 8 | #data 9 | * { colour: #BBC; } 10 | #errors 11 | #expected 12 | | * 13 | #reset 14 | 15 | #data 16 | * { dentist: "Mr Peg"; color: #BBC; dentist: "Mr Peg"; } 17 | #errors 18 | #expected 19 | | * 20 | | color: #ffbbbbcc 21 | #reset 22 | 23 | #data 24 | * { padding-: 4em; } 25 | #errors 26 | #expected 27 | | * 28 | #reset 29 | 30 | -------------------------------------------------------------------------------- /src/third-party/libcss/test/data/select/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for automated parser tests 2 | # 3 | # Test Description 4 | 5 | tests1.dat Basic tests 6 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2007-8 J-M Bell 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | * The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/Makefile.config: -------------------------------------------------------------------------------- 1 | # Configuration Makefile fragment 2 | 3 | # Disable use of iconv in the input filter 4 | # CFLAGS := $(CFLAGS) -DWITHOUT_ICONV_FILTER 5 | 6 | # Cater for local configuration changes 7 | -include Makefile.config.override 8 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/docs/Todo: -------------------------------------------------------------------------------- 1 | Todo list 2 | --------- 3 | 4 | + Charset conversion should use Unicode Normalisation Form C. 5 | 6 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/charset/mibenum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_charset_mibenum_h_ 9 | #define parserutils_charset_mibenum_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | /* Convert an encoding alias to a MIB enum value */ 23 | uint16_t parserutils_charset_mibenum_from_name(const char *alias, size_t len); 24 | /* Convert a MIB enum value into an encoding alias */ 25 | const char *parserutils_charset_mibenum_to_name(uint16_t mibenum); 26 | /* Determine if a MIB enum value represents a Unicode variant */ 27 | bool parserutils_charset_mibenum_is_unicode(uint16_t mibenum); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/charset/utf16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | /** \file 9 | * UTF-16 manipulation functions (interface). 10 | */ 11 | 12 | #ifndef parserutils_charset_utf16_h_ 13 | #define parserutils_charset_utf16_h_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" 17 | { 18 | #endif 19 | 20 | #include 21 | 22 | #include 23 | 24 | parserutils_error parserutils_charset_utf16_to_ucs4(const uint8_t *s, 25 | size_t len, uint32_t *ucs4, size_t *clen); 26 | parserutils_error parserutils_charset_utf16_from_ucs4(uint32_t ucs4, 27 | uint8_t *s, size_t *len); 28 | 29 | parserutils_error parserutils_charset_utf16_length(const uint8_t *s, 30 | size_t max, size_t *len); 31 | parserutils_error parserutils_charset_utf16_char_byte_length(const uint8_t *s, 32 | size_t *len); 33 | 34 | parserutils_error parserutils_charset_utf16_prev(const uint8_t *s, 35 | uint32_t off, uint32_t *prevoff); 36 | parserutils_error parserutils_charset_utf16_next(const uint8_t *s, 37 | uint32_t len, uint32_t off, uint32_t *nextoff); 38 | 39 | parserutils_error parserutils_charset_utf16_next_paranoid(const uint8_t *s, 40 | uint32_t len, uint32_t off, uint32_t *nextoff); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/charset/utf8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | /** \file 9 | * UTF-8 manipulation functions (interface). 10 | */ 11 | 12 | #ifndef parserutils_charset_utf8_h_ 13 | #define parserutils_charset_utf8_h_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" 17 | { 18 | #endif 19 | 20 | #include 21 | 22 | #include 23 | 24 | parserutils_error parserutils_charset_utf8_to_ucs4(const uint8_t *s, size_t len, 25 | uint32_t *ucs4, size_t *clen); 26 | parserutils_error parserutils_charset_utf8_from_ucs4(uint32_t ucs4, uint8_t **s, 27 | size_t *len); 28 | 29 | parserutils_error parserutils_charset_utf8_length(const uint8_t *s, size_t max, 30 | size_t *len); 31 | parserutils_error parserutils_charset_utf8_char_byte_length(const uint8_t *s, 32 | size_t *len); 33 | 34 | parserutils_error parserutils_charset_utf8_prev(const uint8_t *s, uint32_t off, 35 | uint32_t *prevoff); 36 | parserutils_error parserutils_charset_utf8_next(const uint8_t *s, uint32_t len, 37 | uint32_t off, uint32_t *nextoff); 38 | 39 | parserutils_error parserutils_charset_utf8_next_paranoid(const uint8_t *s, 40 | uint32_t len, uint32_t off, uint32_t *nextoff); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_errors_h_ 9 | #define parserutils_errors_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | typedef enum parserutils_error { 19 | PARSERUTILS_OK = 0, 20 | 21 | PARSERUTILS_NOMEM = 1, 22 | PARSERUTILS_BADPARM = 2, 23 | PARSERUTILS_INVALID = 3, 24 | PARSERUTILS_FILENOTFOUND = 4, 25 | PARSERUTILS_NEEDDATA = 5, 26 | PARSERUTILS_BADENCODING = 6, 27 | PARSERUTILS_EOF = 7 28 | } parserutils_error; 29 | 30 | /* Convert a parserutils error value to a string */ 31 | const char *parserutils_error_to_string(parserutils_error error); 32 | /* Convert a string to a parserutils error value */ 33 | parserutils_error parserutils_error_from_string(const char *str, size_t len); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/functypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007-8 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_functypes_h_ 9 | #define parserutils_functypes_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/parserutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_parserutils_h_ 9 | #define parserutils_parserutils_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_types_h_ 9 | #define parserutils_types_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/utils/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2008 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_utils_buffer_h_ 9 | #define parserutils_utils_buffer_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | struct parserutils_buffer 20 | { 21 | uint8_t *data; 22 | size_t length; 23 | size_t allocated; 24 | }; 25 | typedef struct parserutils_buffer parserutils_buffer; 26 | 27 | parserutils_error parserutils_buffer_create(parserutils_buffer **buffer); 28 | parserutils_error parserutils_buffer_destroy(parserutils_buffer *buffer); 29 | 30 | parserutils_error parserutils_buffer_append(parserutils_buffer *buffer, 31 | const uint8_t *data, size_t len); 32 | parserutils_error parserutils_buffer_insert(parserutils_buffer *buffer, 33 | size_t offset, const uint8_t *data, size_t len); 34 | parserutils_error parserutils_buffer_discard(parserutils_buffer *buffer, 35 | size_t offset, size_t len); 36 | 37 | parserutils_error parserutils_buffer_grow(parserutils_buffer *buffer); 38 | 39 | parserutils_error parserutils_buffer_randomise(parserutils_buffer *buffer); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/utils/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2008 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_utils_stack_h_ 9 | #define parserutils_utils_stack_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | struct parserutils_stack; 22 | typedef struct parserutils_stack parserutils_stack; 23 | 24 | parserutils_error parserutils_stack_create(size_t item_size, size_t chunk_size, 25 | parserutils_stack **stack); 26 | parserutils_error parserutils_stack_destroy(parserutils_stack *stack); 27 | 28 | parserutils_error parserutils_stack_push(parserutils_stack *stack, 29 | const void *item); 30 | parserutils_error parserutils_stack_pop(parserutils_stack *stack, void *item); 31 | 32 | void *parserutils_stack_get_current(parserutils_stack *stack); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/include/parserutils/utils/vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2008 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_utils_vector_h_ 9 | #define parserutils_utils_vector_h_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | struct parserutils_vector; 22 | typedef struct parserutils_vector parserutils_vector; 23 | 24 | parserutils_error parserutils_vector_create(size_t item_size, 25 | size_t chunk_size, parserutils_vector **vector); 26 | parserutils_error parserutils_vector_destroy(parserutils_vector *vector); 27 | 28 | parserutils_error parserutils_vector_append(parserutils_vector *vector, 29 | void *item); 30 | parserutils_error parserutils_vector_clear(parserutils_vector *vector); 31 | parserutils_error parserutils_vector_remove_last(parserutils_vector *vector); 32 | parserutils_error parserutils_vector_get_length(parserutils_vector *vector, size_t *length); 33 | 34 | const void *parserutils_vector_iterate(const parserutils_vector *vector, 35 | int32_t *ctx); 36 | const void *parserutils_vector_peek(const parserutils_vector *vector, 37 | int32_t ctx); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/libparserutils.pc.in: -------------------------------------------------------------------------------- 1 | prefix=PREFIX 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/LIBDIR 4 | includedir=${prefix}/INCLUDEDIR 5 | 6 | Name: libparserutils 7 | Description: Utility library for facilitating parser development 8 | Version: VERSION 9 | Libs: -L${libdir} -lparserutils 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/src/charset/aliases.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_charset_aliases_h_ 9 | #define parserutils_charset_aliases_h_ 10 | 11 | #include 12 | 13 | #include 14 | 15 | typedef struct parserutils_charset_aliases_canon { 16 | /* Do not change the ordering here without changing make-aliases.pl */ 17 | uint16_t mib_enum; 18 | uint16_t name_len; 19 | const char *name; 20 | } parserutils_charset_aliases_canon; 21 | 22 | /* Canonicalise an alias name */ 23 | parserutils_charset_aliases_canon *parserutils__charset_alias_canonicalise( 24 | const char *alias, size_t len); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/src/charset/codecs/codec_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_charset_codecs_codecimpl_h_ 9 | #define parserutils_charset_codecs_codecimpl_h_ 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | /** 17 | * Core charset codec definition; implementations extend this 18 | */ 19 | struct parserutils_charset_codec { 20 | uint16_t mibenum; /**< MIB enum for charset */ 21 | 22 | parserutils_charset_codec_errormode errormode; /**< error mode */ 23 | 24 | struct { 25 | parserutils_error (*destroy)(parserutils_charset_codec *codec); 26 | parserutils_error (*encode)(parserutils_charset_codec *codec, 27 | const uint8_t **source, size_t *sourcelen, 28 | uint8_t **dest, size_t *destlen); 29 | parserutils_error (*decode)(parserutils_charset_codec *codec, 30 | const uint8_t **source, size_t *sourcelen, 31 | uint8_t **dest, size_t *destlen); 32 | parserutils_error (*reset)(parserutils_charset_codec *codec); 33 | } handler; /**< Vtable for handler code */ 34 | }; 35 | 36 | /** 37 | * Codec factory component definition 38 | */ 39 | typedef struct parserutils_charset_handler { 40 | bool (*handles_charset)(const char *charset); 41 | parserutils_error (*create)(const char *charset, 42 | parserutils_charset_codec **codec); 43 | } parserutils_charset_handler; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/src/utils/endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2009 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_endian_h_ 9 | #define parserutils_endian_h_ 10 | 11 | static inline bool endian_host_is_le(void) 12 | { 13 | static uint32_t magic = 0x10000002; 14 | 15 | return (((uint8_t *) &magic)[0] == 0x02); 16 | } 17 | 18 | static inline uint32_t endian_swap(uint32_t val) 19 | { 20 | return ((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | 21 | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24); 22 | } 23 | 24 | static inline uint32_t endian_host_to_big(uint32_t host) 25 | { 26 | if (endian_host_is_le()) 27 | return endian_swap(host); 28 | 29 | return host; 30 | } 31 | 32 | static inline uint32_t endian_big_to_host(uint32_t big) 33 | { 34 | if (endian_host_is_le()) 35 | return endian_swap(big); 36 | 37 | return big; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/src/utils/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LibParserUtils. 3 | * Licensed under the MIT License, 4 | * http://www.opensource.org/licenses/mit-license.php 5 | * Copyright 2007 John-Mark Bell 6 | */ 7 | 8 | #ifndef parserutils_utils_h_ 9 | #define parserutils_utils_h_ 10 | 11 | #ifndef max 12 | #define max(a,b) ((a)>(b)?(a):(b)) 13 | #endif 14 | 15 | #ifndef min 16 | #define min(a,b) ((a)<(b)?(a):(b)) 17 | #endif 18 | 19 | #ifndef SLEN 20 | /* Calculate length of a string constant */ 21 | #define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */ 22 | #endif 23 | 24 | #ifndef UNUSED 25 | #define UNUSED(x) ((void)(x)) 26 | #endif 27 | 28 | #ifndef N_ELEMENTS 29 | #define N_ELEMENTS(s) (sizeof((s)) / sizeof((s)[0])) 30 | #endif 31 | 32 | #ifndef ALIGN 33 | #define ALIGN(val) (((val) + 3) & ~(3)) 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/INDEX: -------------------------------------------------------------------------------- 1 | # Index for testcases 2 | # 3 | # Test Description DataDir 4 | 5 | aliases Encoding alias handling 6 | cscodec-utf8 UTF-8 charset codec implementation cscodec-utf8 7 | cscodec-utf16 UTF-16 charset codec implementation cscodec-utf16 8 | cscodec-ext8 Extended 8bit charset codec cscodec-ext8 9 | cscodec-8859 ISO-8859-n codec cscodec-8859 10 | filter Input stream filtering 11 | inputstream Inputstream handling input 12 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/1.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/1.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/10.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/10.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/11.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/11.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/13.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/13.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/14.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/14.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/15.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/15.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/16.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/16.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/2.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/2.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/3.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/3.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/4.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/5.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/5.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/6.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/6.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/7.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/7.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/8.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/8.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/9.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-8859/9.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-8859/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for charset codec tests 2 | # 3 | # Test Description 4 | 5 | 1.dat ISO-8859-1 6 | 2.dat ISO-8859-2 7 | 3.dat ISO-8859-3 8 | 4.dat ISO-8859-4 9 | 5.dat ISO-8859-5 10 | 6.dat ISO-8859-6 11 | 7.dat ISO-8859-7 12 | 8.dat ISO-8859-8 13 | 9.dat ISO-8859-9 14 | 10.dat ISO-8859-10 15 | 11.dat ISO-8859-11 16 | 13.dat ISO-8859-13 17 | 14.dat ISO-8859-14 18 | 15.dat ISO-8859-15 19 | 16.dat ISO-8859-16 20 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for charset codec tests 2 | # 3 | # Test Description 4 | 5 | cp1250.dat Windows-1250 6 | cp1251.dat Windows-1251 7 | cp1252.dat Windows-1252 8 | cp1253.dat Windows-1253 9 | cp1254.dat Windows-1254 10 | cp1255.dat Windows-1255 11 | cp1256.dat Windows-1256 12 | cp1257.dat Windows-1257 13 | cp1258.dat Windows-1258 14 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1250.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1250.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1251.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1251.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1252.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1252.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1253.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1253.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1254.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1254.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1255.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1255.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1256.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1256.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1257.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1257.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-ext8/cp1258.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-ext8/cp1258.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-utf16/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for UTF-16 charset codec tests 2 | # 3 | # Test Description 4 | 5 | simple.dat Simple tests, designed to validate testdriver 6 | 7 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-utf16/simple.dat: -------------------------------------------------------------------------------- 1 | # *** Simple test: 2 | #data decode STRICT 3 | @䅂 4 | #expected PARSERUTILS_OK 5 | @䅂 6 | #reset 7 | 8 | # *** Surrogate test: 9 | #data decode STRICT 10 | �� 11 | #expected PARSERUTILS_OK 12 | 𐌂 13 | #reset 14 | 15 | # *** Lonely high surrogate: 16 | # This is a bit strange that end status is ok. 17 | #data decode STRICT 18 | � 19 | #expected PARSERUTILS_OK 20 | #reset 21 | 22 | # With an extra code point, the status is different. 23 | #data decode STRICT 24 | �䅂 25 | #expected PARSERUTILS_INVALID 26 | #reset 27 | 28 | # *** Wrong low surrogate start: 29 | #data decode STRICT 30 | � 31 | #expected PARSERUTILS_INVALID 32 | #reset 33 | 34 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-utf8/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for charset codec tests 2 | # 3 | # Test Description 4 | 5 | simple.dat Simple tests, designed to validate testdriver 6 | UTF-8-test.txt Markus Kuhn's UTF-8 decoding test file 7 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-utf8/UTF-8-test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-utf8/UTF-8-test.txt -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/cscodec-utf8/simple.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/cscodec-utf8/simple.dat -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/input/INDEX: -------------------------------------------------------------------------------- 1 | # Index file for inputstream tests 2 | # 3 | # Test Description 4 | 5 | UTF-8-test.txt Markus Kuhn's UTF-8 decoding test file 6 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/data/input/UTF-8-test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/DOM-Ruler/20fb101765a1552d435504112efb81f07af93fb2/src/third-party/libparserutils/test/data/input/UTF-8-test.txt -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/regression/INDEX: -------------------------------------------------------------------------------- 1 | # Index for testcases 2 | # 3 | # Test Description DataDir 4 | 5 | filter-segv Segfault in input filtering 6 | stream-nomem Inputstream buffer expansion 7 | filter-badenc-segv Segfault on resetting bad encoding in filter 8 | buffer-discard Memmove beyond data length 9 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/regression/filter-badenc-segv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include "input/filter.h" 7 | 8 | #include "testutils.h" 9 | 10 | int main(int argc, char **argv) 11 | { 12 | parserutils_filter *input; 13 | parserutils_filter_optparams params; 14 | parserutils_error expected; 15 | 16 | #ifndef WITHOUT_ICONV_FILTER 17 | expected = PARSERUTILS_OK; 18 | #else 19 | expected = PARSERUTILS_BADENCODING; 20 | #endif 21 | 22 | UNUSED(argc); 23 | UNUSED(argv); 24 | 25 | assert(parserutils__filter_create("UTF-8", &input) == PARSERUTILS_OK); 26 | 27 | params.encoding.name = "GBK"; 28 | assert(parserutils__filter_setopt(input, 29 | PARSERUTILS_FILTER_SET_ENCODING, ¶ms) == 30 | expected); 31 | 32 | params.encoding.name = "GBK"; 33 | assert(parserutils__filter_setopt(input, 34 | PARSERUTILS_FILTER_SET_ENCODING, ¶ms) == 35 | expected); 36 | 37 | parserutils__filter_destroy(input); 38 | 39 | printf("PASS\n"); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /src/third-party/libparserutils/test/regression/filter-segv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include "input/filter.h" 7 | 8 | #include "testutils.h" 9 | 10 | int main(int argc, char **argv) 11 | { 12 | parserutils_filter *input; 13 | 14 | UNUSED(argc); 15 | UNUSED(argv); 16 | 17 | assert(parserutils__filter_create("UTF-8", &input) == PARSERUTILS_OK); 18 | 19 | parserutils__filter_destroy(input); 20 | 21 | printf("PASS\n"); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /src/third-party/libwapcaplet/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2009 The NetSurf Browser Project 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | * The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/third-party/libwapcaplet/libwapcaplet.pc.in: -------------------------------------------------------------------------------- 1 | prefix=PREFIX 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/LIBDIR 4 | includedir=${prefix}/INCLUDEDIR 5 | 6 | Name: libwapcaplet 7 | Description: String internalisation dictionary 8 | Version: VERSION 9 | Libs: -L${libdir} -lwapcaplet 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/third-party/libwapcaplet/test/testmain.c: -------------------------------------------------------------------------------- 1 | /* test/testmain.c 2 | * 3 | * Core of the test suite for libwapcaplet 4 | * 5 | * Copyright 2009 The NetSurf Browser Project 6 | * Daniel Silverstone 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #include "tests.h" 13 | 14 | #ifndef UNUSED 15 | #define UNUSED(x) ((x) = (x)) 16 | #endif 17 | 18 | /* This means that assertion failures are silent in tests */ 19 | #ifndef NDEBUG 20 | void __assert_fail(const char *__assertion, const char *__file, 21 | unsigned int __line, const char *__function) { 22 | (void)__assertion; 23 | (void)__file; 24 | (void)__line; 25 | (void)__function; 26 | abort(); 27 | } 28 | #endif 29 | 30 | int 31 | main(int argc, char **argv) 32 | { 33 | int number_failed = 0; 34 | SRunner *sr; 35 | 36 | UNUSED(argc); 37 | UNUSED(argv); 38 | 39 | sr = srunner_create(suite_create("Test suite for libwapcaplet")); 40 | 41 | lwc_basic_suite(sr); 42 | // lwc_memory_suite(sr); 43 | 44 | srunner_set_fork_status(sr, CK_FORK); 45 | srunner_run_all(sr, CK_ENV); 46 | number_failed = srunner_ntests_failed(sr); 47 | 48 | srunner_free(sr); 49 | 50 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 51 | } 52 | -------------------------------------------------------------------------------- /src/third-party/libwapcaplet/test/tests.h: -------------------------------------------------------------------------------- 1 | /* test/tests.h 2 | * 3 | * Set of test suites for libwapcaplet 4 | * 5 | * Copyright 2009 The NetSurf Browser Project 6 | * Daniel Silverstone 7 | */ 8 | 9 | #ifndef lwc_tests_h_ 10 | #define lwc_tests_h_ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #include "libwapcaplet/libwapcaplet.h" 17 | 18 | extern void lwc_basic_suite(SRunner *); 19 | extern void lwc_memory_suite(SRunner *); 20 | 21 | #endif /* lwc_tests_h_ */ 22 | -------------------------------------------------------------------------------- /src/tools/debian/changelog: -------------------------------------------------------------------------------- 1 | hvml-dom-ruler (0.0.1-1) unstable; urgency=medium 2 | 3 | * Initial release (Closes: #nnnn) 4 | 5 | -- lichenggang Thu, 25 Aug 2022 17:18:20 +0800 6 | -------------------------------------------------------------------------------- /src/tools/debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /src/tools/debian/control: -------------------------------------------------------------------------------- 1 | Source: hvml-dom-ruler 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Vincent Wei 5 | Build-Depends: debhelper (>= 11), cmake, libglib2.0-dev, libhvml-purc-dev, hvml-purc-bin 6 | Standards-Version: 4.1.3 7 | Homepage: https://github.com/HVML/DOM-Ruler 8 | 9 | Package: hvml-dom-ruler 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: DOM Ruler is a library to maintain a DOM tree 13 | DOM Ruler is a library to maintain a DOM tree, lay out and stylize 14 | the DOM elements by using CSS (Cascaded Style Sheets). 15 | It integrates LibCSS (MIT licensed), LibParserUtils (MIT licensed) 16 | and LibWapcaplet (MIT licensed) from open source community. 17 | -------------------------------------------------------------------------------- /src/tools/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: dom-ruler 3 | Source: https://github.com/HVML/DOM-Ruler 4 | 5 | Files: * 6 | Copyright: 2021, 2022 FMSoft Technologies 7 | License: GPL-3+ 8 | 9 | License: GPL-3+ 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License along 21 | with this program; if not, write to the Free Software Foundation, Inc., 22 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23 | . 24 | On Debian systems, the full text of the GNU General Public 25 | License version 3 can be found in the file 26 | '/usr/share/common-licenses/GPL-3'. 27 | 28 | License: LGPL-2.1 29 | On Debian systems, the full text of the GNU Library Public License 2.1 30 | can be found in the file '/usr/share/common-licenses/LGPL-2.1'. 31 | 32 | -------------------------------------------------------------------------------- /src/tools/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/tools/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | --------------------------------------------------------------------------------