Web Page Style Determination via Hierarchical File Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing style file systems for web page elements suffer from namespace pollution, leading to unclear hierarchical structures and difficulties in reusing class names among modules.
Innovation Solution
A style determination method that acquires and merges style information from multiple style files associated with a child element, including its own style file, the root element's style file, and style files along the element chain, to determine target style information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a globally unique style sheet is used, then all style information can be centralized, but the style sheet becomes bulky and the hierarchical structure becomes unclear
Solution Approach 1:
The patent segments the monolithic global style sheet into multiple hierarchical style files organized by element type (root element style file, child element style files, and intermediate element style files). This segmentation divides the bulky style sheet into manageable, organized units that maintain clear hierarchical relationships while preserving style information reusability across different modules.
2Productivity
If class names are used globally across modules, then style information can be shared, but namespace pollution occurs and class names become difficult to reuse
Solution Approach 1:
The patent introduces a hierarchical dimension to class names by organizing them into different levels (root element class names, intermediate element class names, and child element class names). This dimensional organization allows style information to be shared across modules through the hierarchical structure while maintaining class name uniqueness at each level, thereby avoiding namespace pollution.
3Manufacturing precision
If multiple style files are merged for a child element, then complete style information can be obtained, but the processing complexity increases
Solution Approach 1:
The patent applies preliminary action by pre-organizing style information into hierarchical style files with clear inheritance relationships before processing. The root element style file, intermediate element style files, and child element style files are structured in advance with defined merging rules, so that when style information is needed, the system can efficiently retrieve and merge the relevant files without complex processing, ensuring both completeness and manageability.
Data Source
AI summary
The present disclosure relates to style determination method, apparatus, device, storage medium and program product. The method comprises: acquiring a style file associated with a child element, wherein the style file associated with the child element comprises one or more of: a style file corresponding to the child element, a style file corresponding to a root element of the child element, and a style file corresponding to an element on an element chain between the child element and the root element; acquiring first style information corresponding to the child element from at least one or more of the style files; determining a target style information corresponding to the child element based on at least one or more the first style information.


