WO2014071749A1 - 一种基于html5协议的网页展现方法及装置 - Google Patents

一种基于html5协议的网页展现方法及装置 Download PDF

Info

Publication number
WO2014071749A1
WO2014071749A1 PCT/CN2013/079845 CN2013079845W WO2014071749A1 WO 2014071749 A1 WO2014071749 A1 WO 2014071749A1 CN 2013079845 W CN2013079845 W CN 2013079845W WO 2014071749 A1 WO2014071749 A1 WO 2014071749A1
Authority
WO
WIPO (PCT)
Prior art keywords
dom object
text
dom
unit
picture
Prior art date
Application number
PCT/CN2013/079845
Other languages
English (en)
French (fr)
Inventor
谢成鸿
Original Assignee
北京中娱在线网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京中娱在线网络科技有限公司 filed Critical 北京中娱在线网络科技有限公司
Priority to KR1020157013991A priority Critical patent/KR20150079867A/ko
Priority to US14/438,307 priority patent/US20150286739A1/en
Priority to JP2015540019A priority patent/JP2016505911A/ja
Publication of WO2014071749A1 publication Critical patent/WO2014071749A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Definitions

  • HTML5 Hypertext Markup Language 5rd, also known as the HTML Standard Edition
  • HTML Standard Edition is a new HTML protocol standard that replaces the HTML 4.01 and XHTML 1.0 protocols developed in 1999.
  • the HTML5 protocol has two prominent features: First, it enhances the performance of Web pages; Second, it adds Web applications such as local databases, and its purpose is to reduce the browser-based rich application of web applications. (The need for plug-in-based rich internet applications, RIA, Adobe Flash, Microsoft Silverlight, Oracle JavaFX, etc.) provides more standard sets of effective enhanced network applications.
  • the embodiment of the present application provides a webpage presentation method based on the HTML5 protocol and a corresponding device thereof, so as to provide a webpage presentation based on the HTML5 protocol without an additional plug-in program or function upgrade.
  • the webpage presentation method based on the HTML5 protocol provided by the embodiment of the present application includes:
  • the parsing the webpage resource in the Javascript language to generate the DOM object node specifically includes: Call the DOM object creation function to create a DOM object node based on the HTML tag. Further preferably, lexical analysis of web resources in the Javascript language is performed to obtain
  • the DOM object creation function creates the Javascript code of the DOM object node, and the call DOM object creation function creates a DOM object node according to the HTML tag, specifically:
  • the DOM object node is created by calling the Javascript code corresponding to the HTML tag according to the HTML tag.
  • the method further comprises: implementing control of the DOM object in a Javascript language, specifically:
  • the DOM object, the base class of the DOM object, and the visual element interface are implemented in the Javascript language, and the DOM object node is added and/or deleted according to the HTML tag in the DOM object, and/or, and the attribute of the DOM object node is set according to the HTML tag attribute.
  • the method further includes: controlling a style of the at least one DOM object node, specifically:
  • the style resource of the DOM object node is compiled into Javascript code, and the compiled Javascript code is encapsulated into a function; the function is called to perform style control on the corresponding DOM object node.
  • the method further comprises: performing a typesetting on the changed DOM object node, wherein the change comprises adding, deleting, and/or changing the DOM object node, and the typesetting process is specifically through Javascript.
  • the language performs the following steps:
  • the rendering DOM object includes a text drawing step
  • the text drawing step includes: searching, according to the text size, whether there is a picture matching the text size in the preset picture set; and when there is a matching picture, determining whether the picture is to be included
  • the drawn text if yes, draw the text by using the position information of the text in the picture; if not, draw the text to be drawn into the picture, and use the position information of the text in the picture to draw the text;
  • a picture matching the text size is created, the text to be drawn is drawn into the picture, and the text is drawn by the position information of the text in the picture.
  • the rendering DOM object includes a material merging step, and the material merging step comprises: creating a blank texture;
  • the object to be drawn is placed in the texture, and the position information of the object to be drawn in the texture is recorded; when the drawing trigger is received, all the objects to be drawn in the texture are drawn to the image according to the position information of the object to be drawn in the texture at one time. on the screen.
  • the application also provides a webpage presentation device based on the HTML5 protocol.
  • the device comprises: an acquisition unit, a parsing unit and a rendering unit, wherein:
  • the obtaining unit is configured to acquire a webpage resource based on an HTML5 protocol
  • the parsing unit is configured to parse a webpage resource in a Javascript language to generate a DOM object node, and the rendering unit is configured to render a webpage after rendering the DOM object.
  • the parsing unit comprises a lexical analysis subunit, a DOM object node generating subunit, and a towel thereof:
  • the lexical analysis subunit configured to perform lexical analysis on a webpage resource in a Javascript language to obtain an HTML tag
  • the DOM object node generates a sub-unit for calling a DOM object creation function to create a DOM object node according to an HTML tag.
  • the parsing unit further comprises a code generating subunit, configured to generate a Javascript corresponding to the HTML tag after the lexical analysis of the webpage resource in the Javascript language to obtain the HTML tag, and generate a Javascript of the DOM object node corresponding to the HTML tag.
  • the code, the DOM object node generating sub-unit specifically creates a DOM object node according to an HTML tag calling a Javascript code corresponding to the HTML tag.
  • the device further includes a DOM object control unit, configured to implement control of the DOM object in a Javascript language, specifically:
  • the DOM object, the base class of the DOM object, and the visual element interface are implemented in the Javascript language, and the DOM object node is added and/or deleted according to the HTML tag in the DOM object, and/or, and the attribute of the DOM object node is set according to the HTML tag attribute.
  • the apparatus further includes a style control unit, configured to pair at least one DOM object node
  • the style is controlled by compiling the style resource of the DOM object node into Javascript code, and encapsulating the compiled j avascr ipt code into a function; calling the function to perform style control on the corresponding DOM object node.
  • the apparatus when the DOM object changes, the apparatus further includes a typesetting unit configured to typeset the changed DOM object node, wherein the change includes adding, deleting, and/or changing the DOM object node, and the typesetting process is specific.
  • a typesetting unit configured to typeset the changed DOM object node, wherein the change includes adding, deleting, and/or changing the DOM object node, and the typesetting process is specific.
  • the rendering DOM object tree includes text drawing
  • the rendering unit includes a text drawing unit
  • the text drawing unit includes: a retrieval subunit, a determination subunit, a creation subunit, a first drawing subunit, and a second drawing. Subunit, where:
  • the search subunit is configured to retrieve, according to the text size, whether there is a picture matching the text size in the preset picture set, if yes, triggering the determining subunit; if not, triggering to create the subunit;
  • the determining subunit is configured to determine whether the matched picture includes the text to be drawn, and if yes, triggering the first drawing subunit to draw the text by using the position information of the text in the picture; if not, triggering the second drawing
  • the unit draws the text to be drawn into the picture, and triggers the first drawing subunit to draw the text by using the position information of the text in the picture;
  • the creating subunit is configured to create a picture that matches the size of the text, triggering the second drawing subunit to draw the text to be drawn into the picture, and triggering the first drawing subunit to use the position information of the text in the picture.
  • Draw text is configured to create a picture that matches the size of the text, triggering the second drawing subunit to draw the text to be drawn into the picture, and triggering the first drawing subunit to use the position information of the text in the picture.
  • the rendering DOM object includes a material merging
  • the rendering unit includes a material merging unit
  • the material merging unit comprises: a texture creating subunit, a position information recording subunit, and a third drawing subunit, wherein:
  • the texture creation subunit is configured to create a blank texture
  • the position information recording subunit is configured to place an object to be drawn into a texture, and record position information of the object to be drawn in the texture;
  • the third drawing sub-unit is configured to, when receiving the drawing trigger, the texture according to the object to be drawn.
  • the position information in the drawing draws all the objects to be drawn in the texture to the screen at one time.
  • the embodiment of the present application parses the webpage resource in the Javascript language to generate a DOM object node, and then renders the DOM object and then displays the webpage.
  • the embodiment of the present application adopts the Javascript language as the parsing language for the webpage resource based on the HTML5 protocol. Since the language is ubiquitous in various web browsers, the embodiment of the present application does not need an external plug-in.
  • the program can realize the support of the HTML5 protocol, avoiding the operation of plug-in installation or function update and upgrade, and improving the display efficiency of the webpage based on the HTML5 protocol.
  • the embodiment of the present application since the embodiment of the present application only relies on the Javascript language to support the HTML5 protocol, it can be widely applied to various platforms including the Javascript language, and the webpage presentation performance of these platforms is increased or improved, and a platform-wide development is provided. mode.
  • FIG. 1 is a flowchart of a webpage presentation method based on the HTML5 protocol according to the first embodiment of the present invention
  • FIG. 2 is a flowchart of a webpage presentation method based on the HTML5 protocol according to the second embodiment of the present application; Method flow chart;
  • Figure 5 (a) ⁇ (e) is a schematic diagram of the merge process of the third embodiment of the present application.
  • FIG. 6 is a structural block diagram of an HTML5 protocol-based webpage presentation apparatus according to Embodiment 4 of the present application.
  • DETAILED DESCRIPTION OF THE EMBODIMENTS In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present application. The described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope shall fall within the scope of the application.
  • Embodiment 1 The web page presentation process includes a series of closely connected operations, such as downloading web resources, parsing and rendering web resources, and the like. There are differences in the parsing process of web resources based on different protocol standards. It is because of this difference that more browsers cannot support web resources like HTML5 based protocols. The common practice of the prior art to solve this problem is to use external plugins. The program is upgraded through a dedicated upgrade package, and these practices are contrary to the HTML5 protocol's purpose of reducing plug-in usage. The application completes the parsing process through the Javascript language provided by the browser, thereby better solving the above problem.
  • FIG. 1 shows a flow of a webpage presentation method based on an HTML5 protocol in an embodiment of the present application.
  • This embodiment includes:
  • Step S101 Obtain a webpage resource based on the HTML5 protocol
  • the sources of web resources mainly include two ways: one is the web resource downloaded from the server (the first web resource), and the other is the web resource dynamically generated based on the resources downloaded from the server ( Secondary web resources).
  • the webpage resource from the server side is that after the user sends an access request including the page address to the server through the browser, the server provides the webpage resource to the browser in response to the request.
  • the webpage resources downloaded from the server can be immediately provided to the browser, or the downloaded webpage resources can be cached according to actual application requirements, and then provided after the triggering of the webpage resource is generated.
  • the method for obtaining the webpage resource based on the HTML5 protocol in the embodiment may include multiple types, for example, the method may be an instant request instant access method, or may be, after receiving the webpage resource acquisition trigger, extracting the webpage resource from the cache. .
  • the webpage resource generated by downloading certain program segments in the webpage resource for example, the webpage code generated by the script program running, the webpage triggered by some controls is generated. Resources, etc.
  • the webpage resources required for the present application include the above-mentioned webpage resources from the server, and the webpage resources generated locally, and are not particularly distinguished.
  • the specific type of the obtained HTML5 protocol-based webpage resource is not limited in this embodiment, and may be any combination or combination of text, picture, sound, video, and the like.
  • Step S102 parsing a webpage resource in a Javascript language to generate a DOM object node
  • the JavaScript language is a webpage scripting language supported by the browser.
  • the traditional way of using it is mainly for webpage information interaction and webpage logic control, which is attached to webpages and browsers.
  • the Javascript language is used as a running language, and the webpage resource is parsed and used to generate a DOM.
  • Object node A DOM (Document Object Model) object is a collection of nodes or pieces of information that are organized into hierarchical elements of a page element. It is a standard component that is independent of browser, platform, and language.
  • Step S103 Perform a webpage presentation after rendering the DOM object
  • the DOM object reflects the relationship, location, and other information between the various page elements in the web page. These page elements are represented by the nodes of the DOM object, and the location and other information are attributes of the DOM object node, and the entire DOM is included by the node containing multiple DOM object nodes.
  • the rendering of the object the realization of the page. When rendering is implemented, you can use any of the renderers supported by the browser to render the DOM object. This selection operation can be judged at the beginning of the system. When there are multiple renderers, for example, the system supports both WebGL, Falshll, HTML5 canvas and other renderers. In this case, in addition to randomly selecting a renderer, multiple renderers can be prioritized. Level, select according to priority.
  • the present embodiment parses the webpage resource in the Javascript language to generate a DOM tree presentation structure, and then displays the DOM tree after rendering the structure.
  • this embodiment adopts the Javascript language as a parsing language for web resources based on the HTML5 protocol. Since the language is ubiquitous among various web browsers, the embodiment does not need an external plug-in program. Support for the HTML5 protocol can be realized, and operations such as plug-in installation or function update and upgrade are avoided, and the rendering efficiency of the webpage based on the HTML5 protocol is improved.
  • Embodiment 2 since the embodiment of the present application only relies on the Javascript language to support the HTML5 protocol, it can be widely applied to various platforms including the Javascript language, and the webpage presentation performance of these platforms is increased or improved, and a platform-wide development is provided. mode. Embodiment 2
  • the above embodiment implements the support of the HTML5-based web page by using the Javascript language as the parsing language.
  • the Javascript language is used as the parsing language to parse the webpage resources, and includes various implementation manners.
  • the present application preferably completes the parsing process according to the following embodiments. Referring to FIG. 2, the figure shows a flow of a webpage presentation method based on the HTML5 protocol in the second embodiment of the present application. This embodiment includes:
  • Step S201 Obtain a webpage resource based on the HTML5 protocol
  • Step S202 Perform lexical analysis on the webpage resource in the Javascript language to obtain an HTML tag.
  • the obtained webpage resource usually exists in the form of an HTML code file.
  • the HTML5 tag needs to be identified from the HTML code file, so that the node object of the DOM tree is created by using the tag.
  • tags and tag types supported by different HTML versions such as HTML, HEAD, STYLE, SCRIPT, LINK, BODY, DIV, IMG, A, FONT, CANVAS, BR, SVG, webGL.
  • this embodiment performs lexical analysis on web resources in the Javascript language.
  • Step S203 Calling a DOM object creation function to create a DOM object node according to the HTML tag;
  • the DOM object creation function can be called according to the tag to create a DOM object node.
  • the process can be performed immediately after parsing a tag, or after all HTML tags in an HTML code file are parsed. For example, when the DOM object node is generated every time an HTML tag is parsed, this step calls the DOM object creation function laya.document.createElement (tag name) to generate a DOM object node corresponding to the tag according to the parsed HTML tag. And then continue to parse the next tag. It is worth noting that when the tag has a property value, you can also call the DOM object set function to set the properties of the generated DOM object node.
  • Step S204 Perform a webpage presentation after rendering the DOM object.
  • This embodiment can also achieve the technical effects of the foregoing embodiments.
  • the technical solution of the embodiment can be improved according to actual needs to meet special requirements.
  • the new DOM tag can be supported by the above management operations. As long as the javiscript object code of laya.docHTML [tag name] Element is completed, the specified DOM object system can be generated when document. createElement is called.
  • the foregoing embodiment details the parsing process of the page resource in the present application. After parsing the page resource, what specific rendering manner is used to render the parsed DOM tree presentation structure, or what kind of rendering rendering efficiency is improved before rendering.
  • the pre-processing measures are not limited in this embodiment of the present application, and thus do not affect the implementation of the object of the present application.
  • the application can also implement corresponding operations based on the Javascript language to improve the rendering and personalization and efficiency. These operations include style control, typography, text drawing, etc. The following is a detailed description of the specific process for implementing these operations based on Javascript.
  • Style control is used to define the display style of visual elements of webpages. In actual applications, style control can be performed by default (no extra action is required), and style control can be specified according to special needs. Style control needs to determine the source of the style definition. Generally, the style definition source includes the following four: browser default style (browser default), external style sheet (intermediate style sheet), internal style sheet (intern style sheet), inline style sheet ( Inline style ), this These can be collectively referred to as style resources, and style resources can exist in memory in a static manner, or can be dynamically generated as needed.
  • the embodiment first compiles the style resource of the DOM tree node into Javascript code, and encapsulates the compiled j avascr ipt code into a function; The corresponding DOM object node is style controlled. Take the following code snippet as an example: tmpstyle ⁇ left: 10px;top:20px;color:red ⁇ . First compile the style control code snippet into Javascript code:
  • the process of displaying web pages contains a style control process, which usually involves formatting the requirements according to the requirements of the style control.
  • style control process usually involves formatting the requirements according to the requirements of the style control.
  • modifying the DOM object nodes such as adding, deleting or modifying attributes, the typesetting operation will also be triggered. .
  • this embodiment can also use the Javascript language to perform the typesetting step: collecting the changed DOM object node and its child nodes to form a typesetting set; calculating the DOM object node in the typesetting set New attribute information, the attribute information may be a folding, a position, a width, etc.; the original attribute information of the DOM object node is modified by the new attribute information, and then the DOM object node is typeset according to the new attribute information.
  • FIG. 3 the figure shows a process for implementing text rendering in the embodiment, and the process includes:
  • Step S301 Retrieving, according to the text size, whether there is a picture matching the size of the text in the preset picture set, if yes, executing step S302; if not, executing step S305;
  • Step S302 determining whether the picture contains the text to be drawn, if yes, executing step S303; if not, executing step S304:
  • Step S303 returning the position information of the text in the picture, using the information to draw the text, and ending the process;
  • Step S304 Draw the text to be drawn into the picture, draw the text by using the position information of the text in the picture, and end the process;
  • Step S305 Create a picture matching the text size, draw the text to be drawn into the picture, and draw the text by using the position information of the text in the picture.
  • the embodiment provides a material merging method, which first combines the text, the picture, the expression animation, and the like to be drawn onto a pre-created blank texture, after the blank texture is filled. Draw and submit at one time, which greatly reduces the total number of draws of the graphics card and improves efficiency.
  • FIG. 4 the figure shows the flow of the material merging method of this embodiment. The process includes:
  • Step S401 creating a blank texture
  • the process of creating a blank texture can be created by using a driver layer (DirectX, OpenGL), and the size thereof is not limited in this embodiment, and can be determined according to the number of characters, icons, and the like that may be actually drawn;
  • a driver layer DirectX, OpenGL
  • Step S402 placing the object to be drawn in a blank texture, and recording position information of the object to be drawn in the texture;
  • the object to be drawn is not directly drawn onto the screen, but is first merged into the blank texture, and then the position information of the object to be drawn in the texture is recorded.
  • the objects to be drawn here include text, pictures, animated expressions, and the like.
  • the implementation manner of the foregoing step S402 may specifically include multiple types.
  • the grid algorithm may be adopted, and the entire blank texture is first divided into multiple grids (16*16), and then the number of grids to be occupied is determined according to the width and height information of the object to be drawn. Then, the grid is traversed row by row, and the position of the object to be drawn in the blank texture is determined by acquiring the lattice information.
  • this method can realize the merging of multiple objects to be drawn in the blank texture, the biggest disadvantage of the way of traversing the grid line by line is that the number of loop traversal is too much, which seriously affects the efficiency.
  • each grid saves the number of its own right and lower continuous grids, and each time the traversal does not consider the state of the surrounding grid, directly determines the position where the object to be drawn can be placed, and then performs the merge operation, and then Adjust the information on the left and top grids.
  • Figure 5 (a) is the starting state of the blank texture, the blank texture is divided into 8 * 8 grid, Figure 5 (b) is filled in the blank texture
  • Figure 5 (b) is filled in the blank texture
  • Figure 5 (c) is the texture of the second object to be drawn (1*1)
  • Figure 5 (d) is the fill The texture of the three objects to be drawn (7*2), because the first row and the second row can no longer place the object to be drawn, so it is placed in the third row of the texture
  • Figure 5 (e) is the fill The texture of the fourth object to be drawn (1*1).
  • Another improvement is: store the number of blank grids per line. When traversing, first determine whether the width of the object to be drawn exceeds the number of blank grids of the row. If it exceeds, it will directly go to the next row, and so on.
  • FIG. 6 the figure shows a block diagram of a web page presentation device based on the HTML5 protocol.
  • the device embodiment includes: an obtaining unit 601, a parsing unit 602, and a rendering unit 603, where:
  • the obtaining unit 601 is configured to obtain a webpage resource based on the HTML5 protocol
  • the parsing unit 602 is configured to parse the webpage resource in the Javascript language to generate a DOM object node, and the rendering unit 603 is configured to render the webpage after rendering the DOM object.
  • the working process of the embodiment of the device is: the obtaining unit 601 first obtains a webpage resource based on the HTML5 protocol, and then the parsing unit 602 parses the webpage resource in the Javascript language to generate a DOM object. The node, the final rendering unit 603 renders the DOM object and performs webpage presentation.
  • the device embodiment parses the webpage resource in the Javascript language to generate a DOM tree presentation structure, and then renders the DOM tree to display the structure and then displays it.
  • the device embodiment adopts the Javascript language as a parsing language for web resources based on the HTML5 protocol. Since the language is ubiquitous among various web browsers, the device embodiment does not need an external plug-in. The program can realize the support of the HTML5 protocol, avoiding the operation of plug-in installation or function update and upgrade, and improving the display efficiency of the webpage based on the HTML5 protocol.
  • the device embodiment since the device embodiment only relies on the Javascript language to support the HTML5 protocol, it can be widely applied to various platforms including the Javascript language, and the webpage presentation performance of these platforms is increased or improved, and a platform-wide development is provided. mode.
  • the parsing unit in the foregoing apparatus embodiment may have different structures according to different parsing manners.
  • the parsing unit 602 may include a lexical analysis subunit 6021 and a DOM object node generating subunit 6022, where: a lexical analysis subunit 6021, The lexical analysis of web resources in the Javascript language to obtain HTML tags; the DOM object node generation sub-unit 6022 for calling the DOM object creation function to create a DOM object node according to the HTML tags.
  • the parsing unit may further include a code generating sub-unit 6023, configured to generate a Javascript code for creating a DOM object node by calling a DOM object creation function corresponding to the HTML tag after performing lexical analysis on the webpage resource in the Javascript language to obtain an HTML tag. Then, the DOM object node generating sub-unit specifically creates a DOM object node according to an HTML tag calling a Javascript code corresponding to the HTML tag.
  • the rendering unit in the above device embodiment may include different structural units according to the specific case of performing the rendering operation, thereby having different internal structures.
  • some units can be added according to actual needs for specific purposes.
  • the foregoing device embodiment may further include a DOM object control unit, configured to implement control of the DOM object in the Javascript language, specifically: implementing a DOM object, a base class of the DOM object, and a visual element interface in the Javascript language, in the DOM object. Adding and/or deleting DOM object nodes according to HTML tags, and/or setting properties of DOM object nodes according to HTML tag attributes.
  • the control unit provides the developer with the ability to customize the label.
  • the above device embodiment may further include a style control unit 604, configured to pair at least one The style of the DOM object node is controlled by: compiling the style resource of the DOM object node into Javascript code, and encapsulating the compiled Javascript code into a function; calling the function to perform style control on the corresponding DOM tree node. If the style control process triggers a typographic operation of the rendering or a change, deletion, or attribute modification of the DOM object node, the apparatus embodiment may further include a typesetting unit 605 for formatting the DOM object node in which the change has occurred.
  • the change includes the addition, deletion, and/or style change of the DOM object node, and the typesetting process specifically performs the following steps through the Javascript language: collecting the DOM object node and its child nodes that have changed to form a typesetting set; The attribute information of the DOM object node is changed; the original attribute information of the DOM object node is modified by using the new attribute information, thereby realizing typesetting.
  • the rendering unit 603 may include a text drawing unit 6031, and the text drawing unit 6031 further includes: a retrieval subunit, a determination subunit, a creation subunit, a first drawing subunit, and a second drawing.
  • a search subunit configured to retrieve, according to the text size, whether there is a picture matching the size of the text in the preset picture set, if yes, triggering the determining subunit; if not, triggering to create the subunit; a unit, configured to determine whether the matched picture includes the text to be drawn, and if yes, triggering the first drawing subunit to draw the text by using the position information of the text in the picture; if not, triggering the second drawing subunit to be drawn
  • the text is drawn into the picture, and triggers the first drawing sub-unit to draw the text by using the position information of the text in the picture; creating a sub-unit for creating a picture matching the text size, triggering the second drawing sub-unit to be Draw the drawn text into the image and trigger the first drawing
  • the subunit draws text using the position information of the text in the picture.
  • the rendering unit 603 may include a material merging unit 6032, and the material merging unit 6032 includes: a texture creating subunit, a position information recording subunit, and a third drawing subunit, where: texture creation a sub-unit for creating a blank texture; a position information recording sub-unit, configured to place an object to be drawn into the texture, and record position information of the object to be drawn in the texture; a third drawing sub-unit, configured to receive When the trigger is drawn, all the objects to be drawn in the texture are drawn onto the screen at one time according to the position information of the object to be drawn in the texture.
  • the above devices are described separately by function into various units. Certainly, the functions of each unit may be implemented in the same software or software and/or hardware in the implementation of the present application.
  • the device that implements the webpage display above aggregates other functions of the browser to form a browser.
  • the browser is capable of supporting HTML5.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.
  • This application can be used in a variety of general purpose or special purpose computing system environments or configurations.
  • personal computer server computer, handheld or portable device, tablet device, multiprocessor system, microprocessor based system, set-top box, programmable consumer electronics device, network PC, small computer, mainframe computer, including A distributed computing environment of any of the above systems or devices, and the like.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Document Processing Apparatus (AREA)
  • Stored Programmes (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)

Abstract

本申请实施例公开了一种基于HTML5协议的网页展现方法。该方法包括:获取基于HTML5协议的网页资源;以Javascript语言解析网页资源生成DOM对象节点;渲染DOM对象后进行网页展现。本申请实施例还公开了一种基于HTML5协议的网页展现的展现装置。本申请实施例无需借助外在的插件程序即可实现对HTML5协议的支持,避免了进行插件安装或者功能更新升级等操作,提高了基于HTML5协议的网页的展现效率。

Description

一种基于 HTML5协议的网页展现方法及装置 本申请要求于 2012 年 11 月 6 日提交中国专利局、 申请号为 201210438976.8、发明名称为 "一种基于 HTML5协议的网页展现方法及装置" 的中国专利申请的优先权, 该在先申请的全部内容通过引用结合在本申请中。 技术领域 本申请涉及信息展现技术领域,特别涉及一种基于 HTML5协议的网页展 现方法及其相应的装置。
背景技术
HTML5 ( Hypertext Markup Language 5rd, 超文本标记语言标准第 5版, 又 称为 HTML标准版本 )是用于取代 1999年制定的 HTML 4.01和 XHTML 1.0协 议的新 HTML协议标准。 HTML5协议相对于以前的版本具有两大突出特点: 一是强化了 Web网页的表现性能; 二是增加了本地数据库等 Web应用功能, 其 目的在于通过减少浏览器对基于插件的丰富性网络应用服务(plug-in-based rich internet application, RIA, ^口 Adobe Flash、 Microsoft Silverlight, Oracle JavaFX等) 的需求, 提供更多有效增强网络应用的标准集。
然而, 由于 HTML5协议对插件需求的减少, 在现有技术框架下, 目前的 浏览器(比如 IE6.0〜8.0、 搜狗、 火狐、 Chrome等)如果没有额外的插件程序, 或者不进行必要的功能升级, 将无法基于 HTML5协议实现网页展现。
发明内容
为解决上述技术问题,本申请实施例提供一种基于 HTML5协议的网页展 现方法及其对应的装置,以提供一种无需额外的插件程序或功能升级即可进行 基于 HTML5协议的网页展现。
本申请实施例提供的基于 HTML5协议的网页展现方法包括:
获取基于 HTML5协议的网页资源;
以 Javascript语言解析网页资源生成 DOM对象节点;
渲染 DOM对象后进行网页展现。
优选地, 所述以 Javascript语言解析网页资源生成 DOM对象节点具体包 括: 调用 DOM对象创建函数根据 HTML标签创建 DOM对象节点。 进一步优选地, 在以 Javascript 语言对网页资源进行词法分析以获得
HTML标签后,生成与 HTML标签相应的调用 DOM对象创建函数创建 DOM 对象节点的 Javascript代码, 则所述调用 DOM对象创建函数根据 HTML标签 创建 DOM对象节点具体为:
根据 HTML标签调用与该 HTML标签相应的 Javascript代码创建 DOM对 象节点。
优选地, 所述方法还包括: 以 Javascript语言实现 DOM对象的控制, 具 体为:
以 Javascript语言实现 DOM对象、 DOM对象的基类以及可视元素接口, 在 DOM对象中根据 HTML标签增加和 /或删除 DOM对象节点 , 和 /或 , 根据 HTML标签属性设置 DOM对象节点的属性。
优选地, 所述方法还包括: 对至少一个 DOM对象节点的样式进行控制, 具体为:
将 DOM对象节点的样式资源编译为 Javascript代码, 并将编译形成的 Javascript代码封装为函数; 调用该函数对相应的 DOM对象节点进行样式控 制。
进一步优选地, 当 DOM对象发生变化时, 所述方法还包括, 对发生变化 的 DOM对象节点进行排版, 所述变化包括 DOM对象节点的增加、 删除和 / 或样式变化, 排版过程具体为通过 Javascript语言执行如下步骤:
收集发生变化的 DOM对象节点及其子节点形成排版集合;
计算排版集合内的 DOM对象节点的变化后的属性信息;
用变化后的属性信息修改变化前的属性信息。
优选地, 所述渲染 DOM对象包括文字绘制步骤, 该文字绘制步骤包括: 根据文字尺寸检索预置图片集中是否存在与该文字尺寸匹配的图片; 当存在匹配的图片时, 判断该图片是否包含待绘制的文字, 如果是, 则利 用该文字在图片中的位置信息绘制文字; 如果否, 则将待绘制的文字绘制到该 图片中, 利用该文字在图片中的位置信息绘制文字; 当不存在匹配的图片时,创建与该文字尺寸匹配的图片,将待绘制的文字 绘制到该图片中, 利用该文字在图片中的位置信息绘制文字。
优选地, 所述渲染 DOM对象包括材质合并步骤, 该材质合并步骤包括: 创建空白纹理;
将待绘制对象放置于纹理之中, 记录待绘制对象在纹理中的位置信息; 当接收到绘制触发时,根据待绘制对象在纹理中的位置信息一次性将纹理 中的全部待绘制对象绘制到屏幕上。
本申请还提供了一种基于 HTML5协议的网页展现装置。 该装置包括: 获 取单元、 解析单元和渲染单元, 其中:
所述获取单元, 用于获取基于 HTML5协议的网页资源;
所述解析单元,用于以 Javascript语言解析网页资源生成 DOM对象节点; 所述渲染单元, 用于渲染 DOM对象后进行网页展现。
优选地,所述解析单元包括词法分析子单元、 DOM对象节点生成子单元, 其巾:
所述词法分析子单元, 用于以 Javascript语言对网页资源进行词法分析以 获得 HTML标签;
所述 DOM 对象节点生成子单元, 用于调用 DOM 对象创建函数根据 HTML标签创建 DOM对象节点。
进一步优选地,所述解析单元还包括代码生成子单元,用于在以 Javascript 语言对网页资源进行词法分析以获得 HTML标签后, 生成与 HTML标签相应 的调用 DOM对象创建函数创建 DOM对象节点的 Javascript代码 ,则所述 DOM 对象节点生成子单元具体根据 HTML 标签调用与该 HTML 标签相应的 Javascript代码创建 DOM对象节点。
优选地, 所述装置还包括 DOM对象控制单元, 用于以 Javascript语言实 现 DOM对象的控制, 具体为:
以 Javascript语言实现 DOM对象、 DOM对象的基类以及可视元素接口, 在 DOM对象中根据 HTML标签增加和 /或删除 DOM对象节点 , 和 /或 , 根据 HTML标签属性设置 DOM对象节点的属性。
优选地, 所述装置还包括样式控制单元, 用于对至少一个 DOM对象节点 的样式进行控制,具体为将 DOM对象节点的样式资源编译为 Javascript代码, 并将编译形成的 javascript代码封装为函数; 调用该函数对相应的 DOM对象 节点进行样式控制。
优选地, 当 DOM对象发生变化时, 所述装置还包括排版单元, 用于对发 生变化的 DOM对象节点进行排版, 所述变化包括 DOM对象节点的增加、 删 除和 /或样式变化, 排版过程具体为通过 Javascript语言执行如下步骤:
收集发生变化的 DOM对象节点及其子节点形成排版集合;
计算排版集合内的 DOM对象节点变化后的属性信息;
用变化后的属性信息修改变化前的属性信息。
优选地, 所述渲染 DOM对象树包括文字绘制, 所述渲染单元包括文字绘 制单元, 所述文字绘制单元包括: 检索子单元、 判断子单元、 创建子单元、 第 一绘制子单元和第二绘制子单元, 其中:
所述检索子单元,用于根据文字尺寸检索预置图片集中是否存在与该文字 尺寸匹配的图片, 如果存在, 则触发判断子单元; 如果不存在, 则触发创建子 单元;
所述判断子单元, 用于判断匹配的图片是否包含待绘制的文字, 如果是, 则触发第一绘制子单元利用该文字在图片中的位置信息绘制文字; 如果否, 则 触发第二绘制子单元将待绘制的文字绘制到该图片中,并触发第一绘制子单元 利用该文字在图片中的位置信息绘制文字;
所述创建子单元, 用于创建与该文字尺寸匹配的图片,触发第二绘制子单 元将待绘制的文字绘制到该图片中,并触发第一绘制子单元利用该文字在图片 中的位置信息绘制文字。
优选地, 所述渲染 DOM对象包括材质合并, 所述渲染单元包括材质合并 单元, 所述材质合并单元包括: 纹理创建子单元、位置信息记录子单元和第三 绘制子单元, 其中:
所述纹理创建子单元, 用于创建空白纹理;
所述位置信息记录子单元, 用于将待绘制的对象放置于纹理之中,记录待 绘制对象在纹理中的位置信息;
所述第三绘制子单元, 用于在接收到绘制触发时,根据待绘制对象在纹理 中的位置信息一次性将纹理中的全部待绘制对象绘制到屏幕上。
本申请实施例在获取基于 HTML5协议的网页资源后, 以 Javascript语言 解析网页资源生成 DOM对象节点, 然后渲染 DOM对象后进行网页展现。 与 现有技术相比, 本申请实施例采用 Javascript语言作为对基于 HTML5协议的 网页资源的解析语言, 由于该语言普遍存在于各种网页浏览器之中, 本申请实 施例无需借助外在的插件程序即可实现对 HTML5协议的支持,避免了进行插 件安装或者功能更新升级等操作,提高了基于 HTML5协议的网页的展现效率。 此外, 由于本申请实施例仅依赖于 Javascript语言支持 HTML5协议 , 因此可 广泛应用于包含 Javascript语言的各种平台之上, 增加或提升了这些平台的网 页展现性能, 提供了一种全平台的开发模式。
附图说明 为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本申请中记载的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本申请实施例一的基于 HTML5协议的网页展现方法流程图; 图 2为本申请实施例二的基于 HTML5协议的网页展现方法流程图; 图 3为本申请实施例三的实现文字绘制的方法流程图;
图 4为本申请实施例三的材质合并的方法流程图;
图 5 ( a ) 〜(e ) 为本申请实施例三的合并过程示意图;
图 6为本申请实施例四的基于 HTML5协议的网页展现装置的结构框图。 具体实施方式 为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本 申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本申请一部分实施例, 而不是全部的实施例。 基 于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获 得的所有其他实施例, 都应当属于本申请保护的范围。 实施例一 网页展现过程包括一系列紧密相连的操作, 比如网页资源的下载, 对网页 资源的解析、 渲染等。 基于不同协议标准的网页资源的解析过程存在差别, 正 是由于这种差异导致较多的浏览器无法支持像基于 HTML5协议的网页资源, 现有技术解决该问题的通常做法是借助于外在插件程序或者通过专门的升级 程序包实现升级, 而这些做法与 HTML5协议减少插件使用的宗旨相悖。 本申 请通过浏览器自带的 Javascript语言完成解析过程, 从而较好地解决了上述问 题。
参见图 1 , 该图示出了本申请实施例的基于 HTML5协议的网页展现方法 的流程。 该实施例包括:
步骤 S101 : 获取基于 HTML5协议的网页资源;
获取网页资源是进行网页展现的基础, 网络资源的来源主要包括两种途 径: 一是从服务器端下载的网页资源 (首次网页资源), 二是基于从服务器端 下载的资源动态生成的网页资源 (二次网页资源)。 来自于服务器端的网页资 源,是用户通过浏览器向服务器发送包含页面地址的访问请求后,服务端响应 该请求向浏览器提供该网页资源。从服务器端下载到的网页资源可以即时提供 给浏览器, 也可以根据实际应用需要, 先将下载的网页资源进行緩存, 待对网 页资源的获取触发产生后才提供。 与此相应地, 本实施例获取基于 HTML5协 议的网页资源的方式可以包括多种, 比如, 可以是即时请求即时获得方式, 也 可以是在接收到网页资源获取触发后,从緩存中提取网页资源。对于生成的网 页资源, 其是借助于本地系统的处理计算功能,运行下载网页资源中的某些程 序段生成的网页资源, 比如, 脚本程序运行产生的网页代码, 某些控件被触发 产生的网页资源等。 需要说明的是: 本申请所需的网页资源既包括上述来自服 务器的网页资源, 也包括在本地生成的网页资源, 并不特别的区分。 此外, 本 实施例对获取的基于 HTML5协议的网页资源的具体类型不作限定, 比如可以 是文本、 图片、 声音、 视频等资源中任何一种或几组的组合。
步骤 S 102: 以 Javascript语言解析网页资源生成 DOM对象节点;
JavaScript语言是浏览器支持的网页脚本语言, 传统使用方式主要是将其 用于网页信息交互和网页逻辑控制, 它依附于网页和浏览器存在。本实施例以 Javascript语言为运行语言, 使用其对网页资源进行解析操作, 进而生成 DOM 对象节点。 DOM ( Document Object Model, 文档对象模型 )对象是以层次结 构对页面元素进行组织的节点或信息片断的集合, 它是与浏览器、 平台、语言 无关的标准组件。
步骤 S103: 渲染 DOM对象后进行网页展现;
DOM对象反映了网页中的各个页面元素之间的关系、 位置等信息, 这些 页面元素通过 DOM对象的节点体现, 位置等信息为 DOM对象节点的属性, 通过对包含多个 DOM对象节点的整个 DOM对象的渲染, 即可实现页面的展 现。 具体实现渲染时, 可以选用浏览器支持的任何一种渲染器对 DOM对象渲 染, 该选择操作可以在系统初始时判断。 当存在多个渲染器时, 比如系统同时 支持 WebGL、 Falshll、 HTML5画布等渲染器, 这种情形下, 除可以采用随机 选择一种渲染器的方式外,还可以对多个渲染器设定优先级,根据优先级进行 选择。
本实施例在获取基于 HTML5协议的网页资源后, 以 Javascript语言解析 网页资源生成 DOM树展现结构, 然后在渲染 DOM树展现结构后进行展现。 与现有技术相比, 本实施例采用 Javascript语言作为对基于 HTML5协议的网 页资源的解析语言, 由于该语言普遍存在于各种网页浏览器之中, 本实施例无 需借助外在的插件程序即可实现对 HTML5协议的支持,避免了进行插件安装 或者功能更新升级等操作,提高了基于 HTML5协议的网页的展现效率。此外, 由于本申请实施例仅依赖于 Javascript语言支持 HTML5协议, 因此可广泛应 用于包含 Javascript语言的各种平台之上, 增加或提升了这些平台的网页展现 性能, 提供了一种全平台的开发模式。 实施例二
上述实施例以 Javascript语言作为解析语言实现了基于 HTML5协议的网 页的支持。 实际应用过程中以 Javascript语言作为解析语言对网页资源的解析 包括多种实现方式, 本申请优选按照如下的实施例完成解析过程。 参见图 2, 该图示出了本申请实施例二的基于 HTML5协议的网页展现方法流程。该实施 例包括:
步骤 S201 : 获取基于 HTML5协议的网页资源; 步骤 S202: 以 Javascript语言对网页资源进行词法分析以获得 HTML标 签;
获取的网页资源通常以 HTML代码文件形式存在, 进行网页展现, 需要 先从 HTML代码文件中识别出 HTML5的标签,以便利用该标签创建 DOM树 的节点对象。 不同 HTML协议版本支持的标签数量和标签种类存在差别, 比 如 HTML5协议支持的标签包括: HTML、 HEAD, STYLE、 SCRIPT, LINK, BODY, DIV、 IMG、 A、 FONT, CANVAS、 BR、 SVG, webGL。 为解析出 HTML标签, 本实施例以 Javascript语言对网页资源进行词法分析。 具体词法 分析方式可以是: 逐字符读取 HTML代码文件内容, 将 "<" 之后的字符识别 为 HTML标签。 比如对于如下代码段 "<img width= '100, src= 'l.gif >" , 经过逐字符读取代码段后, 将 "<" 后的 "img" 识别为 HTML标签。
步骤 S203: 调用 DOM对象创建函数根据 HTML标签创建 DOM对象节 点;
识别出 HTML 标签后, 即可根据该标签调用 DOM对象创建函数创建 DOM 对象节点, 该过程可以在一个标签解析出来即刻进行, 也可以在一个 HTML代码文件内的全部 HTML标签解析完成后进行。 比如, 当采用每解析 完一个 HTML 标签即生成 DOM对象节点的方式时, 本步骤根据解析出的 HTML标签调用 DOM对象创建函数 laya.document.createElement (标签名 )生 成与该标签对应的 DOM对象节点,然后继续解析下一个标签。值得注意的是: 当标签具有属性值时, 还可以调用 DOM对象 set函数设置生成的 DOM对象 节点的属性。
步骤 S204: 渲染 DOM对象后进行网页展现。
本实施例同样能够取得前述实施例的技术效果。此外,在此实施例基石出上, 还可以根据实际需要, 对本实施例的技术方案进行改进以满足特殊要求。
比如, 在实际应用过程中, 为提高解析速度, 可以对本实施例的解析步骤 进行改进:在以 Javascript语言对网页资源进行词法分析获取 HTML标签之前, 先将 HTML代码文件编译为 Javascript代码。 经过这样的预处理后, 在下次解 析相同代码段时, 将不再需要进行语法分析, 进而大大提高解析效率。 仍以前 述代码段为例: 假设 "<img width= '100, src= 'l.gif " 代码段在代码文件中 多次出现, 当第一次进行词法分析时, 将该代码段翻译成如下的 Javascript代 码(伪代码):
function htmlCache— 1(· ..)
{
var obj=document.createElement("img");
obj.set("width",100);
obj.set("src",n 1.gif );
obj.onCreated();
}
当再次解析 "<img width= ' 100' src= 'l.gif " 代码段时, 不需进行解析 该代码段的标签、 属性等信息的操作, 而只需调用 htmlCache— 1 ( ) 即可。 还比如, 基于本实施例, 还可以基于 Javascript语言对 DOM对象进行各 种 控 制 管 理 操作 : 将 标 签 添加 到 DOM 对 象 ( 比 如 , [element] . appendChild(element) )、 从 DOM 对象中删除标签 ( 比如, [element]. removeChild(element) ) , 或者修改 DOM树中节点的属性 (比如, [element]. setAttribute(nodeName,nodeValue) )„ 实现这种管理的基本原理是使用 javascript语言实现 document (网页文档管理对象)、 node ( Dom对象的基类, 提供树形管理和属性操作等接口)、 HTMLElement (提供可视元素的基本接 口)。 值得强调的是: 传统实现 document, node, HTMLElement等多是通过其 他语言实现,比如 C++、 JAVA,采用这些语言存在如前所述的难以兼容 HTML5 的问题,针对该问题的解决的主流思路也主要是利用这些语言完成, 而本申请 实施例采用 Javascript语言为载体实现且实现效果达到甚至超过现有技术, 克 服了传统技术偏见, 取得了较好的效果。 通过上述管理操作可以支持新的 DOM标签, 只要完成 laya.docHTML [标 签名 ]Element的 j avascript对象代码, 调用 document. createElement时能生成指 定的 DOM对象系统就新增了 div和 img的标签功能, 因此, 通过本实施例, 系统和开发者可以无需升级浏览器完成新的标签和功能扩展和升级, 举例如 下: laya.doc.HTMLDivElement=function(nodeName)
{
…代码 }
laya.doc.HTMLImgElement=function(nodeName)
{
…代码 }
传统浏览器访问 DOM通过 javascript接口调用由 C实现的本地接口, 由 于 javascript调用本地接口效率低, 因此开发大型网络游戏无法利用浏览器的 DOM优势。 本实施例由于 DOM的所有代码本身直接使用 javascript编写, javascript接口之间的调用开销远小于 javascript与本地接口的互调,因此 DOM 的操作效率提升, 为以 DOM为核心的游戏或大型项目开发带来了可能。
实施例三
前述实施例详细介绍了本申请对页面资源的解析过程, 解析完页面资源 后, 采用何种具体的渲染方式对解析生成的 DOM树展现结构进行渲染, 或者 在渲染之前进行何种提高渲染展现效率的预处理措施,本申请实施例对此并不 作限定, 这样并不影响本申请的发明目的的实现。 但是, 在实际应用过程, 本 申请还可以基于 Javascript语言实现相应的操作, 以提高渲染展现个性化和效 率。 这些操作包括样式控制、 排版、 文本绘制等过程, 以下依次介绍基于 Javascript实现这些操作的具体流程。
对于样式控制: 样式控制是用于定义网页可视元素的显示风格的, 实际应 用中可以采用默认方式进行样式控制 (不需要采取额外的操作), 也可以根据 特别需求进行指定的样式控制。样式控制需要确定样式定义源,通常情况样式 定义源包括如下四种:浏览器默认样式( browser default )、外部样式表( external style sheet )、 内部样式表 ( internal style sheet )、 内嵌样式表 ( inline style ), 这 些可统称为样式资源,样式资源可以以静态方式存在于内存中,也可以根据需 要临时动态生成。 如果 DOM对象中存在非默认的至少一个 DOM对象节点的 样式控制, 本实施例先将 DOM树节点的样式资源编译为 Javascript代码, 并 将编译形成的 javascript代码封装为函数; 调用该函数对相应的 DOM对象节 点进行样式控制。 以如下代码段为例: tmpstyle{left: 10px;top:20px;color:red}。 先将该样式控制代码段编译为 Javascript代码:
laya.document.styleCache["tmpstyle"]
{
this.setLeft(lO);
this.setTop(20);
this.setColor("red");
}
然 后 将 编 译 形 成 的 Javascript 代 码 封 装 为 函 数 : laya. document. sty leCache [ " tmpstyle" ] =function() , 这样, 渲染的样式控制过程时 可以直接执行 laya.document.styleCache["tmpstyle"].call(this) , 而不需分析 {left: 10px;top:20px;color:red}的描述。 通过本实施例将样式控制代码段编译为 Javascript代码段的方式进行样式控制, 与传统的以 C++或者 Java进行样式控 制的方式相比, 无需用户升级更新浏览器, 提高了样式解析的速度。
对于排版: 展现网页过程中包含有样式控制过程,通常会涉及到根据样式 控制的要求出发排版需求, 在对 DOM对象节点进行修改, 比如增加、 删除或 修改属性等情形下, 也将触发排版操作。 与传统的借助于 C或 JAVA代码进行 排版操作不同, 本实施例同样可以采用 Javascript语言进行排版步骤: 收集发 生变化的 DOM对象节点及其子节点形成排版集合; 计算排版集合内的 DOM 对象节点的新属性信息, 该属性信息可以是折行、 位置、 宽度等; 利用新属性 信息修改 DOM对象节点的原属性信息, 然后根据新属性信息对 DOM对象节 点进行排版。
对于文字绘制: 当面对页面展现渲染过程中的大量文字绘制时,传统的文 字绘制通常采用矢量图方式进行绘制,但这种绘制文字的效率较低。本实施例 对此进行改进, 以绘制图片方式绘制文字, 这种方式可提高包含文字绘制的渲 染过程的效率。 参见图 3 , 该图示出了本实施例的实现文字绘制的过程, 该过 程包括:
步骤 S301 : 根据文字尺寸检索预置图片集中是否存在与该文字尺寸匹配 的图片, 如果存在, 则执行步骤 S302; 如果否, 则执行步骤 S305;
步骤 S302:判断该图片是否包含待绘制的文字,如果是,则执行步骤 S303; 如果否, 则执行步骤 S304:
步骤 S303: 返回该文字在图片中的位置信息, 利用该信息绘制文字, 结 束流程;
步骤 S304: 将待绘制的文字绘制到该图片中, 利用该文字在图片中的位 置信息绘制文字, 结束流程;
步骤 S305: 创建与该文字尺寸匹配的图片, 将待绘制的文字绘制到该图 片中, 利用该文字在图片中的位置信息绘制文字。
对于材质合并: 在实际的网页展现的渲染过程中, 比如 3D、 2D的网络游 戏环境, 存在大量的文字、 图标或表情动画的绘制。 传统做法是: 每个元素绘 制一次,通常情况下整个屏幕上的绘制次数会可能超过 200次, 而影响渲染效 果的因素通常包括显卡绘制次数和屏幕填充率,超过 200次的绘制次数将大大 降低渲染效率。 针对该问题, 本实施例提供了一种材质合并方法, 该方法先将 待绘制的文字、 图片、 表情动画等内容合并到一张预先创建的空白纹理之上, 待该空白纹理填充完后再一次性进行绘制提交,从而大大减少了显卡的总绘制 次数, 提高了效率。 参见图 4, 该图示出了本实施例的材质合并方法的流程。 该流程包括:
步骤 S401 : 创建空白纹理;
创建空白纹理的过程可通过驱动层(DirectX, OpenGL )创建, 其大小本 实施例不作限定, 可根据实际可能绘制的文字、 图标等数量的多少确定;
步骤 S402: 将待绘制对象放置于空白纹理之中, 记录待绘制对象在纹理 中的位置信息;
本实施例并不直接将待绘制对象绘制到屏幕上,而是先将其合并到空白纹 理中, 然后记录下这些待绘制对象在纹理中的位置信息。这里的待绘制对象包 括文字、 图片、 动画表情等。 步骤 S403: 当接收到绘制触发时, 根据待绘制对象在纹理中的位置信息 一次性将绘制纹理中的全部待绘制对象绘制到屏幕上;
上述步骤 S402的实现方式可以具体包括多种, 比如可以采取格子算法, 先将整个空白纹理划分为多个格子(16*16 ), 再根据待绘制对象的宽、 高等信 息确定要占用的格子数, 然后逐行遍历格子,通过获取格子信息确定待绘制对 象在空白纹理中的位置。这种方式尽管能够实现多个待绘制对象在空白纹理中 的合并,但是逐行遍历格子的方式最大缺点是循环遍历次数过多,严重影响效 率提高。 一种改进的方式是: 每个格子都保存自己右、 下连续格子的个数, 每 次遍历时不再考虑周边格子的状态, 直接确定待绘制对象可以放置的位置, 然 后进行合并操作, 进而调整自己左边、 上边格子的信息。 参见图 5 ( a ) 〜(e ), 其中: 图 5 ( a )是空白纹理的开始状态, 该空白纹理被划分为 8*8的网格, 图 5 ( b )为在该空白纹理中填充了一张占 (2*2 )个格子的待绘制对象后的纹 理情况, 图 5 ( c )为填充第二张待绘制对象( 1*1 )的纹理情况; 图 5 ( d )为 填充第三张待绘制对象(7*2 ) 的纹理情况, 由于第一行、 第二行已不能放置 下该待绘制对象, 所以将其放置到纹理的第三行中; 图 5 ( e ) 为填充第四张 待绘制对象(1*1 )的纹理情况。 另一种改进方式是: 存储每行的空白格子数, 遍历时先判断待绘制对象的宽度是否超出该行的空白格子数,如果超过, 则直 接转入下一行, 依次类推。 实施例四
以上是对本申请方法实施例的描述,本申请还提供了基于 HTML5协议的 网页展现装置实施例。 参见图 6, 该图示出了基于 HTML5协议的网页展现装 置的结构框图。 本装置实施例包括: 获取单元 601、 解析单元 602和渲染单元 603 , 其中:
获取单元 601 , 用于获取基于 HTML5协议的网页资源;
解析单元 602 , 用于以 Javascript语言解析网页资源生成 DOM对象节点; 渲染单元 603 , 用于渲染 DOM对象后进行网页展现。
本装置实施例的工作过程是: 获取单元 601先获取基于 HTML5协议的网 页资源, 然后由解析单元 602以 Javascript语言解析网页资源生成 DOM对象 节点, 最后渲染单元 603渲染 DOM对象后进行网页展现。
本装置实施例在获取基于 HTML5协议的网页资源后, 以 Javascript语言 解析网页资源生成 DOM树展现结构,然后渲染 DOM树展现结构后进行展现。 与现有技术相比, 本装置实施例采用 Javascript语言作为对基于 HTML5协议 的网页资源的解析语言, 由于该语言普遍存在于各种网页浏览器之中, 本装置 实施例无需借助外在的插件程序即可实现对 HTML5协议的支持,避免了进行 插件安装或者功能更新升级等操作,提高了基于 HTML5协议的网页的展现效 率。 此外 , 由于本装置实施例仅依赖于 Javascript语言支持 HTML5协议 , 因 此可广泛应用于包含 Javascript语言的各种平台之上, 增加或提升了这些平台 的网页展现性能, 提供了一种全平台的开发模式。
上述装置实施例中的解析单元根据不同的解析方式可以具有不同的结构, 比如, 解析单元 602可以包括词法分析子单元 6021、 DOM对象节点生成子单 元 6022, 其中: 词法分析子单元 6021 , 用于以 Javascript语言对网页资源进行 词法分析以获得 HTML标签; DOM对象节点生成子单元 6022,用于调用 DOM 对象创建函数根据 HTML标签创建 DOM对象节点。 此外, 解析单元还可以 包括代码生成子单元 6023 , 用于在以 Javascript语言对网页资源进行词法分析 以获得 HTML标签后, 生成与 HTML标签相应的调用 DOM对象创建函数创 建 DOM对象节点的 Javascript代码, 则所述 DOM对象节点生成子单元具体 根据 HTML标签调用与该 HTML标签相应的 Javascript代码创建 DOM对象节 点。
上述装置实施例中的渲染单元根据执行渲染操作的具体情况,可以包括不 同的结构单元, 从而具有不同的内部结构。 此外, 在渲染单元之前, 根据实际 需要还可以增加一些单元, 用于实现特定目的。
比如,上述装置实施例还可以包括 DOM对象控制单元,用于以 Javascript 语言实现 DOM对象的控制,具体为: 以 Javascript语言实现 DOM对象、 DOM 对象的基类以及可视元素接口, 在 DOM对象中根据 HTML标签增加和 /或删 除 DOM对象节点, 和 /或, 根据 HTML标签属性设置 DOM对象节点的属性。 通过该控制单元可以为开发者提供自定义标签的功能。
还比如, 上述装置实施例还可以包括样式控制单元 604, 用于对至少一个 DOM对象节点的样式进行控制, 具体为: 将 DOM对象节点的样式资源编译 为 Javascript代码, 并将编译形成的 Javascript代码封装为函数; 调用该函数对 相应的 DOM树节点进行样式控制。如果样式控制过程触发了渲染的排版操作 或者 DOM对象节点发生增加、 删除或属性修改等变化, 进一步地, 上述装置 实施例还可以包括排版单元 605,用于对发生变化进的 DOM对象节点的排版, 所述变化包括 DOM对象节点的增加、删除和 /或样式变化,排版过程具体为通 过 Javascript语言执行如下步骤: 收集发生发生变化的 DOM对象节点及其子 节点形成排版集合; 计算排版集合内的 DOM对象节点变化后的属性信息; 利 用新属性信息修改 DOM对象节点的原属性信息, 从而实现排版。
再比如, 当渲染 DOM对象包括文字绘制时, 渲染单元 603可以包括文字 绘制单元 6031 , 文字绘制单元 6031进一步包括: 检索子单元、 判断子单元、 创建子单元、 第一绘制子单元和第二绘制子单元, 其中: 检索子单元, 用于根 据文字尺寸检索预置图片集中是否存在与该文字尺寸匹配的图片, 如果存在, 则触发判断子单元; 如果不存在, 则触发创建子单元; 判断子单元, 用于判断 匹配的图片是否包含待绘制的文字,如果是, 则触发第一绘制子单元利用该文 字在图片中的位置信息绘制文字; 如果否, 则触发第二绘制子单元将待绘制的 文字绘制到该图片中,并触发第一绘制子单元利用该文字在图片中的位置信息 绘制文字; 创建子单元, 用于创建与该文字尺寸匹配的图片, 触发第二绘制子 单元将待绘制的文字绘制到该图片中,并触发第一绘制子单元利用该文字在图 片中的位置信息绘制文字。
还比如, 当渲染 DOM对象包括材质合并时, 渲染单元 603可以包括材质 合并单元 6032, 该材质合并单元 6032包括: 纹理创建子单元、 位置信息记录 子单元和第三绘制子单元, 其中: 纹理创建子单元, 用于创建空白纹理; 位置 信息记录子单元, 用于将待绘制的对象放置于纹理之中,记录待绘制对象在纹 理中的位置信息; 第三绘制子单元, 用于在接收到绘制触发时, 根据待绘制对 象在纹理中的位置信息一次性将纹理中的全部待绘制对象绘制到屏幕上。
为了描述的方便, 描述以上装置时以功能分为各种单元分别描述。 当然, 在实施本申请时可以把各单元的功能在同一个或多个软件和 /或硬件中实现, 比如, 将上述实现网页展现的装置集合浏览器的其他功能后形成一个浏览器, 该浏览器能够支持 HTML5。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本 申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解, 本申 请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形 式体现出来,该计算机软件产品可以存储在存储介质中 ,如 ROM/RAM、磁碟、 光盘等, 包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相 似的部分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同之 处。 尤其, 对于系统实施例而言, 由于其基本相似于方法实施例, 所以描述得 比较简单,相关之处参见方法实施例的部分说明即可。 以上所描述的系统实施 例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是 物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元, 即可以 位于一个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择 其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在 不付出创造性劳动的情况下, 即可以理解并实施。
本申请可用于众多通用或专用的计算系统环境或配置中。 例如: 个人计算 机、 服务器计算机、 手持设备或便携式设备、 平板型设备、 多处理器系统、 基 于微处理器的系统、 置顶盒、 可编程的消费电子设备、 网络 PC、 小型计算机、 大型计算机、 包括以上任何系统或设备的分布式计算环境等等。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例 如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的 例程、 程序、 对象、 组件、 数据结构等等。 也可以在分布式计算环境中实践本 申请,在这些分布式计算环境中, 由通过通信网络而被连接的远程处理设备来 执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地 和远程计算机存储介质中。
以上所述仅是本申请的具体实施方式,应当指出,对于本技术领域的普通 技术人员来说, 在不脱离本申请原理的前提下, 还可以做出若干改进和润饰, 这些改进和'; 饰也应视为本申请的保护范围。

Claims

权 利 要 求
1、 一种基于 HTML5协议的网页展现方法, 其特征在于, 该方法包括: 获取基于 HTML5协议的网页资源;
以 Javascript语言解析网页资源生成 DOM对象节点;
渲染 DOM对象后进行网页展现。
2、 根据权利要求 1所述的方法, 其特征在于, 所述以 Javascript语言解析 网页资源生成 DOM对象节点具体包括: 调用 DOM对象创建函数根据 HTML标签创建 DOM对象节点。
3、 根据权利要求 2所述的方法, 其特征在于, 在以 Javascript语言对网页 资源进行词法分析以获得 HTML标签后,生成与 HTML标签相应的调用 DOM 对象创建函数创建 DOM对象节点的 Javascript代码, 则所述调用 DOM对象 创建函数根据 HTML标签创建 DOM对象节点具体为:
根据 HTML标签调用与该 HTML标签相应的 Javascript代码创建 DOM对 象节点。
4、 根据权利要求 1至 3中任何一项所述的方法, 其特征在于, 所述方法 还包括: 以 Javascript语言实现 DOM对象的控制, 具体为:
以 Javascript语言实现 DOM对象、 DOM对象的基类以及可视元素接口, 在 DOM对象中根据 HTML标签增加和 /或删除 DOM对象节点 , 和 /或 , 根据 HTML标签属性设置 DOM对象节点的属性。
5、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 对至少 一个 DOM对象节点的样式进行控制, 具体为:
将 DOM对象节点的样式资源编译为 Javascript代码, 并将编译形成的 Javascript代码封装为函数; 调用该函数对相应的 DOM对象节点进行样式控 制。
6、 根据权利要求 5所述的方法, 其特征在于, 当 DOM对象发生变化时, 所述方法还包括,对发生变化的 DOM对象节点进行排版,所述变化包括 DOM 对象节点的增加、 删除和 /或样式变化, 排版过程具体为通过 Javascript语言执 行如下步骤: 收集发生变化的 DOM对象节点及其子节点形成排版集合;
计算排版集合内的 DOM对象节点变化后的属性信息;
用变化后的属性信息修改变化前的属性信息。
7、 根据权利要求 1所述的方法, 其特征在于, 所述渲染 DOM对象包括 文字绘制步骤, 该文字绘制步骤包括:
根据文字尺寸检索预置图片集中是否存在与该文字尺寸匹配的图片; 当存在匹配的图片时, 判断该图片是否包含待绘制的文字, 如果是, 则利 用该文字在图片中的位置信息绘制文字; 如果否, 则将待绘制的文字绘制到该 图片中, 利用该文字在图片中的位置信息绘制文字;
当不存在匹配的图片时,创建与该文字尺寸匹配的图片, 将待绘制的文字 绘制到该图片中, 利用该文字在图片中的位置信息绘制文字。
8、 根据权利要求 1所述的方法, 其特征在于, 所述渲染 DOM对象包括 材质合并步骤, 该材质合并步骤包括:
创建空白纹理;
将待绘制对象放置于纹理之中, 记录待绘制对象在纹理中的位置信息; 当接收到绘制触发时,根据待绘制对象在纹理中的位置信息一次性将纹理 中的全部待绘制对象绘制到屏幕上。
9、 一种基于 HTML5协议的网页展现装置, 其特征在于, 该装置包括: 获取单元、 解析单元和渲染单元, 其中:
所述获取单元, 用于获取基于 HTML5协议的网页资源;
所述解析单元,用于以 Javascript语言解析网页资源生成 DOM对象节点; 所述渲染单元, 用于渲染 DOM对象后进行网页展现。
10、 根据权利要求 9所述的装置, 其特征在于, 所述解析单元包括词法分 析子单元、 DOM对象节点生成子单元, 其中:
所述词法分析子单元, 用于以 Javascript语言对网页资源进行词法分析以 获得 HTML标签;
所述 DOM 对象节点生成子单元, 用于调用 DOM 对象创建函数根据 HTML标签创建 DOM对象节点。
11、根据权利要求 10所述的装置, 所述解析单元还包括代码生成子单元, 与 HTML标签相应的调用 DOM对象创建函数创建 DOM对象节点的 Javascript 代码,则所述 DOM对象节点生成子单元具体根据 HTML标签调用与该 HTML 标签相应的 Javascript代码创建 DOM对象节点。
12、 根据权利要求 9至 11中任何一项所述的装置, 其特征在于, 所述装 置还包括 DOM对象控制单元, 用于以 Javascript语言实现 DOM对象的控制, 具体为:
以 Javascript语言实现 DOM对象、 DOM对象的基类以及可视元素接口, 在 DOM对象中根据 HTML标签增加和 /或删除 DOM对象节点 , 和 /或 , 根据 HTML标签属性设置 DOM对象节点的属性。
13、 根据权利要求 9所述的装置, 其特征在于, 所述装置还包括样式控制 单元, 用于对至少一个 DOM对象节点的样式进行控制, 具体为将 DOM对象 节点的样式资源编译为 Javascript代码,并将编译形成的 Javascript代码封装为 函数; 调用该函数对相应的 DOM对象节点进行样式控制。
14、 根据权利要求 13所述的装置, 其特征在于, 当 DOM对象发生变化 时, 所述装置还包括排版单元, 用于对发生变化的 DOM对象节点进行排版, 所述变化包括 DOM对象节点的增加、删除和 /或样式变化,排版过程具体为通 过 Javascript语言执行如下步骤:
收集发生变化的 DOM对象节点及其子节点形成排版集合;
计算排版集合内的 DOM对象节点变化后的属性信息;
用变化后的属性信息修改变化前的属性信息。
15、 根据权利要求 9所述的装置, 其特征在于, 所述渲染 DOM对象树包 括文字绘制, 所述渲染单元包括文字绘制单元, 所述文字绘制单元包括: 检索 子单元、判断子单元、创建子单元、第一绘制子单元和第二绘制子单元,其中: 所述检索子单元,用于根据文字尺寸检索预置图片集中是否存在与该文字 尺寸匹配的图片, 如果存在, 则触发判断子单元; 如果不存在, 则触发创建子 单元;
所述判断子单元, 用于判断匹配的图片是否包含待绘制的文字, 如果是, 则触发第一绘制子单元利用该文字在图片中的位置信息绘制文字; 如果否, 则 触发第二绘制子单元将待绘制的文字绘制到该图片中,并触发第一绘制子单元 利用该文字在图片中的位置信息绘制文字;
所述创建子单元, 用于创建与该文字尺寸匹配的图片,触发第二绘制子单 元将待绘制的文字绘制到该图片中,并触发第一绘制子单元利用该文字在图片 中的位置信息绘制文字。
16、 根据权利要求 9所述的装置, 其特征在于, 所述渲染 DOM对象包括 材质合并, 所述渲染单元包括材质合并单元, 所述材质合并单元包括: 纹理创 建子单元、 位置信息记录子单元和第三绘制子单元, 其中:
所述纹理创建子单元, 用于创建空白纹理;
所述位置信息记录子单元, 用于将待绘制的对象放置于纹理之中,记录待 绘制对象在纹理中的位置信息;
所述第三绘制子单元, 用于在接收到绘制触发时,根据待绘制对象在纹理 中的位置信息一次性将纹理中的全部待绘制对象绘制到屏幕上。
PCT/CN2013/079845 2012-11-06 2013-07-23 一种基于html5协议的网页展现方法及装置 WO2014071749A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020157013991A KR20150079867A (ko) 2012-11-06 2013-07-23 Html5-프로토콜 기반 웹페이지 표시 방법 및 장치
US14/438,307 US20150286739A1 (en) 2012-11-06 2013-07-23 Html5-protocol-based webpage presentation method and device
JP2015540019A JP2016505911A (ja) 2012-11-06 2013-07-23 Html5プロトコルベースのウェブページ表示方法および装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210438976.8A CN102955854B (zh) 2012-11-06 2012-11-06 一种基于html5协议的网页展现方法及装置
CN201210438976.8 2012-11-06

Publications (1)

Publication Number Publication Date
WO2014071749A1 true WO2014071749A1 (zh) 2014-05-15

Family

ID=47764660

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/079845 WO2014071749A1 (zh) 2012-11-06 2013-07-23 一种基于html5协议的网页展现方法及装置

Country Status (5)

Country Link
US (1) US20150286739A1 (zh)
JP (1) JP2016505911A (zh)
KR (1) KR20150079867A (zh)
CN (1) CN102955854B (zh)
WO (1) WO2014071749A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784202A (zh) * 2021-02-03 2021-05-11 中国电子科技集团公司第二十八研究所 一种基于web技术的提高网页截图清晰度的方法

Families Citing this family (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955854B (zh) * 2012-11-06 2015-11-25 搜游网络科技(北京)有限公司 一种基于html5协议的网页展现方法及装置
CN103279373B (zh) * 2013-05-31 2017-09-22 广州市动景计算机科技有限公司 浏览器外壳功能的更新方法及装置
CN103336690B (zh) * 2013-06-28 2017-02-08 优视科技有限公司 基于html5的文字元素绘制方法及装置
US9317873B2 (en) * 2014-03-28 2016-04-19 Google Inc. Automatic verification of advertiser identifier in advertisements
US11115529B2 (en) 2014-04-07 2021-09-07 Google Llc System and method for providing and managing third party content with call functionality
US20150287099A1 (en) 2014-04-07 2015-10-08 Google Inc. Method to compute the prominence score to phone numbers on web pages and automatically annotate/attach it to ads
CN104866340A (zh) * 2015-04-29 2015-08-26 小米科技有限责任公司 终端设备软件更新方法及装置
KR101708741B1 (ko) 2015-08-18 2017-02-21 카테노이드 주식회사 컨텐츠를 제공하는 에이전트의 인증 방법 및 이를 위한 디스플레이장치
GB2562910B (en) 2015-11-04 2021-04-28 Observepoint Inc Automatic execution of objects in a user interface
CN105487858B (zh) * 2015-11-25 2019-04-02 深圳联友科技有限公司 一种基于html5的在线表单设计系统
CN106873952B (zh) * 2015-12-14 2021-07-20 航天信息股份有限公司 移动端网页开发的数据处理系统和方法、及应用装置
CN105630483B (zh) * 2015-12-16 2019-01-04 青岛海信网络科技股份有限公司 一种组态图元的显示方法及装置
WO2017136755A1 (en) * 2016-02-04 2017-08-10 Observepoint, Inc. Analyzing analytic element network traffic
US10826802B2 (en) 2016-02-09 2020-11-03 Observepoint, Inc. Managing network communication protocols
CN107707965B (zh) * 2016-08-08 2021-02-12 阿里巴巴(中国)有限公司 一种弹幕的生成方法和装置
CN107766359B (zh) * 2016-08-17 2022-03-15 阿里巴巴(中国)有限公司 一种将页面内容转换为图片的方法、装置以及计算设备
CN113282360A (zh) * 2016-09-14 2021-08-20 阿里巴巴集团控股有限公司 2D canvas网页元素的渲染方法、装置及电子设备
US10469424B2 (en) 2016-10-07 2019-11-05 Google Llc Network based data traffic latency reduction
CN108073647B (zh) * 2016-11-14 2020-06-30 腾讯科技(深圳)有限公司 网页显示方法及装置
CN107291465A (zh) * 2017-06-14 2017-10-24 北京小米移动软件有限公司 页面显示方法、装置及存储介质
US11062497B2 (en) 2017-07-17 2021-07-13 At&T Intellectual Property I, L.P. Structuralized creation and transmission of personalized audiovisual data
CN107562861A (zh) * 2017-08-29 2018-01-09 武汉智丽丰信息科技有限公司 一种基于WebGL的WebGIS三维模型系统
US20190180484A1 (en) * 2017-12-11 2019-06-13 Capital One Services, Llc Systems and methods for digital content delivery over a network
CN109255089B (zh) * 2018-07-06 2022-03-11 曙光信息产业(北京)有限公司 基于Html的节点数据处理方法以及系统
CN109344355B (zh) * 2018-09-26 2022-03-15 北京因特睿软件有限公司 针对网页变化的自动回归检测与块匹配自适应方法和装置
CN109542417B (zh) * 2018-11-20 2022-03-01 北京小米移动软件有限公司 一种dom渲染网页的方法、装置、终端和存储介质
CN110442820A (zh) * 2019-07-24 2019-11-12 上海易点时空网络有限公司 用于网页的图片合成方法以及装置
CN111596935A (zh) * 2020-04-27 2020-08-28 五八有限公司 一种脚本打包方法、装置、电子设备及存储介质
CN112040322A (zh) * 2020-08-20 2020-12-04 译发网络科技(大连)有限公司 一种视频说明书制作方法
CN112102450B (zh) * 2020-11-18 2021-02-02 武大吉奥信息技术有限公司 一种基于WebGL三维地图的跑马灯特效通用方法
CN114861103B (zh) * 2022-03-23 2023-11-10 易保网络技术(上海)有限公司 页面回溯方法及其装置、介质和电子设备
CN115981797B (zh) * 2023-03-21 2023-06-20 北京时代新威信息技术有限公司 在JavaFX应用程序中动态加载网页的方法及设备
CN116756708B (zh) * 2023-05-30 2023-12-05 佛山众陶联供应链服务有限公司 一种针对于数字产品页面版权可变粒度的保护方法
KR102620692B1 (ko) 2023-08-21 2024-01-03 주식회사 비전트리 이러닝 콘텐츠 제작을 위한 html5 자동 변환 방법

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763432A (zh) * 2010-01-05 2010-06-30 北京大学 一种轻量级网页动态视图快速构建方法
CN102339291A (zh) * 2010-07-23 2012-02-01 阿里巴巴集团控股有限公司 一种列表生成方法及设备
US20120124123A1 (en) * 2010-11-12 2012-05-17 Microsoft Corporation Extensible video player selection via server-side detection of client application
CN102750281A (zh) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 一种浏览器的脚本处理方法和系统
CN102955854A (zh) * 2012-11-06 2013-03-06 北京中娱在线网络科技有限公司 一种基于html5协议的网页展现方法及装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02297215A (ja) * 1989-03-31 1990-12-07 Canon Inc 出力装置
JPH04149774A (ja) * 1990-10-15 1992-05-22 Hitachi Ltd フォームオーバレイ情報生成方式
NL1025125C2 (nl) * 2003-11-07 2005-05-10 Backbase B V Werkwijze, inrichting en systeem voor het uitbreiden van een mark-up taal.
US8239749B2 (en) * 2004-06-25 2012-08-07 Apple Inc. Procedurally expressing graphic objects for web pages
CN101246491B (zh) * 2008-03-11 2014-11-05 孟智平 一种在网页中使用描述文件的方法和系统
JP5279332B2 (ja) * 2008-04-28 2013-09-04 キヤノン株式会社 画像処理装置、画像処理方法及びプログラム
JP5159711B2 (ja) * 2009-06-25 2013-03-13 インターナショナル・ビジネス・マシーンズ・コーポレーション 組込み機器およびその状態表示制御方法
JP2011044791A (ja) * 2009-08-19 2011-03-03 Canon Inc 画像処理装置、及びその制御方法
WO2011086610A1 (ja) * 2010-01-18 2011-07-21 富士通株式会社 構造化文書を表示するためのコンピュータプログラム、方法、および情報処理装置
US20110191676A1 (en) * 2010-01-29 2011-08-04 Microsoft Corporation Cross-Browser Interactivity Recording, Playback, and Editing
JP5564442B2 (ja) * 2011-01-11 2014-07-30 日本電信電話株式会社 文章検索装置
US8959427B1 (en) * 2011-08-05 2015-02-17 Google Inc. System and method for JavaScript based HTML website layouts
CN102508887A (zh) * 2011-10-19 2012-06-20 江西省南城县网信电子有限公司 一种数字电视交互服务标记语言解析系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763432A (zh) * 2010-01-05 2010-06-30 北京大学 一种轻量级网页动态视图快速构建方法
CN102339291A (zh) * 2010-07-23 2012-02-01 阿里巴巴集团控股有限公司 一种列表生成方法及设备
US20120124123A1 (en) * 2010-11-12 2012-05-17 Microsoft Corporation Extensible video player selection via server-side detection of client application
CN102750281A (zh) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 一种浏览器的脚本处理方法和系统
CN102955854A (zh) * 2012-11-06 2013-03-06 北京中娱在线网络科技有限公司 一种基于html5协议的网页展现方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784202A (zh) * 2021-02-03 2021-05-11 中国电子科技集团公司第二十八研究所 一种基于web技术的提高网页截图清晰度的方法
CN112784202B (zh) * 2021-02-03 2022-10-04 中国电子科技集团公司第二十八研究所 一种基于web技术的提高网页截图清晰度的方法

Also Published As

Publication number Publication date
KR20150079867A (ko) 2015-07-08
JP2016505911A (ja) 2016-02-25
CN102955854A (zh) 2013-03-06
US20150286739A1 (en) 2015-10-08
CN102955854B (zh) 2015-11-25

Similar Documents

Publication Publication Date Title
WO2014071749A1 (zh) 一种基于html5协议的网页展现方法及装置
US11347826B2 (en) Systems and methods for hosted applications
US10325012B2 (en) Filtered stylesheets
US9619913B2 (en) Animation editing
US11216253B2 (en) Application prototyping tool
JP5815114B2 (ja) 中間フォーマットを用いた、swfのhtmlへのクロスコンパイル
US20110167332A1 (en) System and Method for Generating Web Pages
CN110908712A (zh) 移动端跨平台的数据处理方法和设备
US9749440B2 (en) Systems and methods for hosted application marketplaces
CN109725965A (zh) 层叠样式表维护方法、装置、计算机设备及存储介质
CN113126990A (zh) 一种页面开发方法、装置、设备及存储介质
CN106488298B (zh) 一种在ui中图像绘制的方法及装置和电视
CN111723314B (zh) 网页展示方法、装置、电子设备及计算机可读存储介质
CN115659087B (zh) 页面渲染方法、设备及存储介质
KR20140133125A (ko) 클라이언트에서 서버가 제공하는 웹 페이지를 브라우즈하는 방법 및 이를 위한 장치
KR101079966B1 (ko) 웹페이지에서의 동영상 재생을 지원하는 이동통신단말기 및 웹페이지에서의 동영상 재생 지원 방법
CN114168875A (zh) 一种页面程序的生成方法、装置、计算机设备及存储介质
CN111984258A (zh) 页面构建方法和设备
CN112632436A (zh) 一种网页显示方法、装置、电子设备及存储介质
Aryal Design Principles for Responsive Web
TWI610183B (zh) 植基於ajax技術於控管網頁共通部分之運作系統
CN114217780A (zh) 一种支持网页和小程序可视化开发的方法、系统及终端
CN115661311A (zh) 一种滚动特效制作方法、装置、设备及介质
CN118193723A (zh) 文本解析方法、系统、电子设备及存储介质
CN117539491A (zh) 页面布局方法、装置、电子设备、存储介质及程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13852727

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14438307

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2015540019

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20157013991

Country of ref document: KR

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 13852727

Country of ref document: EP

Kind code of ref document: A1