CN104217037A - Method and device for displaying web page in mobile terminal - Google Patents
Method and device for displaying web page in mobile terminal Download PDFInfo
- Publication number
- CN104217037A CN104217037A CN201410525792.4A CN201410525792A CN104217037A CN 104217037 A CN104217037 A CN 104217037A CN 201410525792 A CN201410525792 A CN 201410525792A CN 104217037 A CN104217037 A CN 104217037A
- Authority
- CN
- China
- Prior art keywords
- page
- label
- typesetting
- webpage
- attribute
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000009877 rendering Methods 0.000 claims abstract description 75
- 230000008569 process Effects 0.000 claims abstract description 17
- 238000012545 processing Methods 0.000 claims description 40
- 238000005192 partition Methods 0.000 claims description 16
- 238000010276 construction Methods 0.000 claims description 10
- 230000000694 effects Effects 0.000 abstract description 15
- 230000000875 corresponding effect Effects 0.000 description 47
- 230000004048 modification Effects 0.000 description 32
- 238000012986 modification Methods 0.000 description 32
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000008676 import Effects 0.000 description 4
- 230000000717 retained effect Effects 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000000739 chaotic effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007373 indentation Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本发明公开了一种在移动终端中显示网页的方法及装置,其中,所述方法包括,接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;对所述网页资源中包含的页面元素进行解析,解析过程中判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理;根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树对网页内容进行绘制并显示。通过本发明,能够从一定程度上保留一些应有的画面效果,保证网页显示的生动性。
The present invention discloses a method and device for displaying a webpage in a mobile terminal, wherein the method includes receiving a request for accessing a webpage through a mobile terminal, and obtaining resources corresponding to the webpage from a webpage server according to the request; The page elements contained in the web resource are parsed, and during the parsing process, it is judged whether the label corresponding to the current page element affects the layout, and if there is a label that affects the layout, the label that affects the layout is processed; according to the processed label structure The node of the rendering tree judges whether there is a cascading style sheet CSS attribute that affects the layout. If there is a cascading style sheet CSS attribute that affects the layout, remove the CSS attribute that affects the layout, and then draw and display the webpage content according to the constructed rendering tree. Through the present invention, some due picture effects can be preserved to a certain extent, and the vividness of web page display can be guaranteed.
Description
技术领域technical field
本发明涉及计算机技术领域,特别是涉及一种在移动终端中显示网页的方法及装置。The invention relates to the field of computer technology, in particular to a method and device for displaying web pages in a mobile terminal.
背景技术Background technique
随着科技飞速发展,移动终端(如手机等)已经拥有了强大的处理能力,移动终端正在从简单的通话工具变为一个综合信息处理平台,尤其是利用移动终端浏览网页,已经成为人们获取信息的重要途径。With the rapid development of science and technology, mobile terminals (such as mobile phones, etc.) already have powerful processing capabilities, and mobile terminals are changing from a simple communication tool to a comprehensive information processing platform. important way.
最初,为了能够在移动终端上浏览网页,使用了专门的协议—WAP(Wireless Application Protocol,无线应用协议),网页制作者需要按照该协议制作专用于在移动终端上浏览的网页(这种网页一般是使用WML(Wireless Markup Language)语言来制作的,因此,一般可以简称为WML网页)。但是,随着用户需求的不断提升以及技术的发展,目前也能够在移动终端上浏览普通的HTML(Hypertext Markup Language,超文本标记语言)网页,也即因特网中普遍使用的基于HTML语言制作的网页。然而,这种HTML网页一般都是针对传统的具有较大显示屏的设备(例如台式电脑、笔记本电脑等)而设计的,而对于移动终端(如手机等)而言,由于其显示屏的尺寸比较小,因此,要想在移动终端中正常显示HTML网页,一般还需要预先对HTML网页进行处理,将其转换为类似WML网页的格式。在将HTML网页转换为WML网页的过程中,首先需要对页面元素进行窄排适配处理,也即,需要按照移动终端的屏幕宽度重新对HTML网页中的页面元素进行排版,使得每一行中显示的页面元素数目变少,从而使得在较小的显示屏中显示时,字体不会太小,同时,避免出现水平方向上的滚动条的现象,便于用户的浏览。然而现有技术在对页面进行窄排的过程中,为了避免出现内容溢出手机屏幕或者屏幕留白、重叠显示等现象,一般会将HTML网页中原有的为一些页面元素设计的CSS样式去掉。但是这样就会造成网页显示不生动,一些应有的画面效果消失。Initially, in order to be able to browse webpages on mobile terminals, a special protocol—WAP (Wireless Application Protocol, Wireless Application Protocol) was used. It is made using the WML (Wireless Markup Language) language, so it can generally be referred to as a WML webpage for short). However, with the continuous improvement of user needs and the development of technology, it is also possible to browse ordinary HTML (Hypertext Markup Language, Hypertext Markup Language) webpages on mobile terminals at present, that is, webpages made based on HTML language commonly used in the Internet. . However, such HTML webpages are generally designed for traditional devices with larger display screens (such as desktop computers, notebook computers, etc.), and for mobile terminals (such as mobile phones, etc.), due to the size of the display screen Therefore, in order to normally display an HTML webpage in a mobile terminal, it is generally necessary to process the HTML webpage in advance and convert it into a format similar to a WML webpage. In the process of converting an HTML web page to a WML web page, it is first necessary to perform narrow row adaptation processing on the page elements, that is, it is necessary to re-layout the page elements in the HTML web page according to the screen width of the mobile terminal, so that each line displays The number of page elements is reduced, so that when displayed on a smaller display screen, the font will not be too small, and at the same time, the phenomenon of scroll bars in the horizontal direction is avoided, which is convenient for users to browse. However, in the prior art, in the process of narrowly arranging pages, in order to avoid phenomena such as content overflowing the mobile phone screen or screen blanking, overlapping display, etc., the original CSS styles designed for some page elements in HTML web pages are generally removed. But this will cause the display of the webpage not to be vivid, and some proper picture effects will disappear.
发明内容Contents of the invention
本发明提供了一种在移动终端中显示网页的方法与装置,能够从一定程度上保留一些应有的画面效果,保证网页显示的生动性。The invention provides a method and device for displaying web pages in a mobile terminal, which can retain some due picture effects to a certain extent and ensure the vividness of web page display.
本发明提供了如下方案:The present invention provides following scheme:
一种在移动终端中显示网页的方法,包括:A method for displaying a webpage in a mobile terminal, comprising:
接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;receiving a request for accessing a webpage through a mobile terminal, and obtaining resources corresponding to the webpage from a webpage server according to the request;
对所述网页资源中包含的页面元素进行解析,解析过程中判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理;Analyzing the page elements contained in the webpage resource, judging during the parsing process whether the label corresponding to the current page element affects the typesetting, if there is a label that affects the typesetting, then processing the label that affects the typesetting;
根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树对网页内容进行绘制并显示。Construct the nodes of the rendering tree according to the processed tags, and judge whether there is a cascading style sheet CSS attribute that affects the layout. If there is a cascading style sheet CSS attribute that affects the layout, remove the CSS attribute that affects the layout, and then follow the constructed rendering tree. The content is drawn and displayed.
其中,所述对所述影响排版的标签进行处理包括:Wherein, the processing of the tags that affect typesetting includes:
将影响排版的标签去掉,以便在根据处理后的标签构造渲染树的节点时,将该标签对应的页面元素作为普通文本处理。Remove the tags that affect typesetting, so that when the nodes of the rendering tree are constructed based on the processed tags, the page elements corresponding to the tags are treated as ordinary text.
其中,所述将影响排版的标签去掉包括:Among them, the removal of tags that affect typesetting includes:
如果所述当前正在解析的页面元素为普通卷动元素、下标元素或上标元素,则将这种页面元素的标签去掉。If the page element currently being parsed is a normal scrolling element, a subscript element or a superscript element, the tag of such page element is removed.
其中,所述对所述影响排版的标签进行处理包括:Wherein, the processing of the tags that affect typesetting includes:
将当前页面元素去掉,以便在根据处理后的标签构造渲染树的节点时,不再生成该页面元素对应的节点。Remove the current page element, so that when the node of the rendering tree is constructed according to the processed label, the node corresponding to the page element is no longer generated.
其中,所述将当前页面元素去掉包括:Wherein, said removing the current page element includes:
如果所述当前正在解析的页面元素为普通卷动元素、包含对象的元素、嵌入页面的元素、下标元素或上标元素,则将这种页面元素去掉。If the page element currently being parsed is a common scrolling element, an element containing an object, an element embedded in a page, a subscript element or a superscript element, such page element is removed.
其中,所述对所述影响排版的标签进行处理包括:Wherein, the processing of the tags that affect typesetting includes:
将影响排版的标签中定义的CSS属性值进行修改;Modify the CSS attribute value defined in the label that affects layout;
所述根据处理后的标签构造渲染树的节点包括:The nodes for constructing the rendering tree according to the processed labels include:
利用修改后的CSS属性值为渲染树中该页面元素对应的节点的CSS属性进行赋值。The modified CSS property value is used to assign a value to the CSS property of the node corresponding to the page element in the rendering tree.
其中,所述将影响排版的标签中定义的CSS属性值进行修改包括:Wherein, modifying the CSS attribute values defined in the tags that will affect layout includes:
当所述当前正在解析的页面元素为表格元素时,对表格元素及表格元素的内联元素的CSS值进行修改,以便所述表格元素能够自动换行;When the page element currently being parsed is a table element, the CSS value of the table element and the inline element of the table element is modified so that the table element can wrap automatically;
或者,or,
当所述当前正在解析的页面元素为表单输入控件、下拉菜单/列表、文本域或内联框架元素,并且存在表示其宽度的绝对数值时,将所述绝对数值修改为相对数值;When the page element currently being parsed is a form input control, drop-down menu/list, text field or inline frame element, and there is an absolute value representing its width, modify the absolute value to a relative value;
或者,or,
当所述当前正在解析的页面元素为图像元素时,比较该图像元素的width值与移动终端的屏幕宽度值,如果所述width值大于移动终端的屏幕宽度值,则按照所述width值与移动终端的屏幕宽度之间的比例,等比例缩小所述width值;如果所述width值小于移动终端的屏幕宽度值,但大于移动终端的屏幕宽度值的二分之一,则将该图像元素的位置属性值修改为居中显示;When the page element currently being parsed is an image element, compare the width value of the image element with the screen width value of the mobile terminal, if the width value is greater than the screen width value of the mobile terminal, then move according to the width value and the mobile terminal The ratio between the screen widths of the terminal, the width value is proportionally reduced; if the width value is less than the screen width value of the mobile terminal, but greater than half of the screen width value of the mobile terminal, then the image element The position attribute value is modified to be displayed in the center;
或者,or,
如果所述当前正在解析的页面元素为超链接元素,并且所述超链接元素中包含img标签以及文本,则为所述img标签加入边界属性值;If the page element currently being parsed is a hyperlink element, and the hyperlink element contains an img tag and text, then add a boundary attribute value to the img tag;
或者,or,
如果所述当前正在解析的页面元素为分区元素,则为所述分区元素加入边界属性值。If the page element currently being parsed is a partition element, add a boundary attribute value to the partition element.
其中,所述将渲染树节点中包含的影响排版的CSS属性去掉包括:Wherein, said removing CSS attributes that affect typesetting included in the rendering tree node includes:
将所述当前正在解析的页面元素包含的宽度高度的绝对属性、定位属性、背景图属性和/或与文本显示相关的属性去掉;Remove the absolute attributes of width and height, positioning attributes, background image attributes and/or attributes related to text display contained in the page element currently being parsed;
和/或,and / or,
将元素盒模型中的边框与填充属性去掉。Remove the border and padding properties in the element box model.
其中,如果将所述当前正在解析的页面元素的背景图去掉,则还包括:Wherein, if the background image of the page element currently being parsed is removed, it also includes:
修改所述页面元素中包含的文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。The color attribute value of the text included in the page element is modified to ensure the recognition of the text after the background image is removed.
其中,所述修改所述页面元素中包含的文本的颜色属性值,包括:Wherein, the modifying the color attribute value of the text contained in the page element includes:
如果页面元素内文本颜色是白色,则设置所述文本颜色为网页文本默认颜色;If the text color in the page element is white, then set the text color as the default color of the web page text;
或者,or,
如果网页元素内文本颜色不是白色,并且所述元素背景色不透明,则设置文本颜色为所述元素背景色具有预置色差值的颜色;If the text color in the webpage element is not white, and the background color of the element is opaque, then set the text color to the color of the background color of the element with a preset color difference value;
或者,or,
如果网页元素内文本颜色不是白色,并且所述元素背景色透明,则设置文本颜色为与此网页的主体元素的背景色具有预置色差值的颜色。If the text color in the web page element is not white, and the background color of the element is transparent, the text color is set to a color with a preset color difference value from the background color of the main element of the web page.
一种在移动终端中显示网页的装置,包括:A device for displaying web pages in a mobile terminal, comprising:
资源获取单元,用于接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;A resource obtaining unit, configured to receive a request for accessing a webpage through a mobile terminal, and obtain resources corresponding to the webpage from a webpage server according to the request;
标签处理单元,用于对所述网页资源中包含的页面元素进行解析,解析过程中,判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理;The label processing unit is used to analyze the page elements contained in the webpage resources. During the analysis process, it is judged whether the label corresponding to the current page element affects the typesetting. If there is a label that affects the typesetting, the label that affects the typesetting is processed. deal with;
渲染树构造单元,用于根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树对网页内容进行绘制并显示。The rendering tree construction unit is used to construct the nodes of the rendering tree according to the processed tags, and judge whether there are cascading style sheet CSS attributes that affect the layout. If there are cascading style sheet CSS attributes that affect the layout, remove the CSS attributes that affect the layout, and then Draw and display the web page content according to the constructed rendering tree.
其中,所述标签处理单元包括:Wherein, the label processing unit includes:
标签去掉子单元,用于将影响排版的标签去掉,以便在根据处理后的标签构造渲染树的节点时,将该标签对应的页面元素作为普通文本处理。The tag removal subunit is used to remove tags that affect typesetting, so that when the nodes of the rendering tree are constructed based on the processed tags, the page elements corresponding to the tags are treated as ordinary text.
其中,所述标签去掉子单元具体用于:如果所述当前正在解析的页面元素为普通卷动元素、下标元素或上标元素,则将这种页面元素的标签去掉。Wherein, the label removing subunit is specifically configured to: if the page element currently being parsed is a common scroll element, a subscript element or a superscript element, then remove the label of this page element.
其中,所述标签处理单元包括:Wherein, the label processing unit includes:
元素去掉子单元,用于将当前页面元素去掉,以便在根据处理后的标签构造渲染树的节点时,不再生成该页面元素对应的节点。The element removal subunit is used to remove the current page element, so that when the node of the rendering tree is constructed according to the processed label, the node corresponding to the page element is no longer generated.
其中,所述元素去掉子单元具体用于:如果所述当前正在解析的页面元素为普通卷动元素、包含对象的元素、嵌入页面的元素、下标元素或上标元素,则将这种页面元素去掉。Wherein, the element removal subunit is specifically used for: if the page element currently being parsed is a normal scrolling element, an element containing an object, an element embedded in a page, a subscript element or a superscript element, then element removed.
其中,所述标签处理单元包括:Wherein, the label processing unit includes:
属性值修改子单元,用于将影响排版的标签中定义的CSS属性值进行修改;The attribute value modification subunit is used to modify the CSS attribute value defined in the tag that affects layout;
所述渲染树构造单元还用于:The rendering tree construction unit is also used for:
利用修改后的CSS属性值为渲染树中该页面元素对应的节点的CSS属性进行赋值。The modified CSS property value is used to assign a value to the CSS property of the node corresponding to the page element in the rendering tree.
其中,所述属性值修改子单元包括:Wherein, the attribute value modification subunit includes:
第一修改子单元,用于当所述当前正在解析的页面元素为表格元素时,对表格元素及表格元素的内联元素的CSS值进行修改,以便所述表格元素能够自动换行;The first modification subunit is used to modify the CSS value of the table element and the inline element of the table element when the page element currently being parsed is a table element, so that the table element can wrap automatically;
或者,or,
第二修改子单元,用于当所述当前正在解析的页面元素为表单输入控件、下拉菜单/列表、文本域或内联框架元素,并且存在表示其宽度的绝对数值时,将所述绝对数值修改为相对数值;The second modification subunit is used to convert the absolute value to Modified to a relative value;
或者,or,
第三修改子单元,用于当所述当前正在解析的页面元素为图像元素时,比较该图像元素的width值与移动终端的屏幕宽度值,如果所述width值大于移动终端的屏幕宽度值,则按照所述width值与移动终端的屏幕宽度之间的比例,等比例缩小所述width值;如果所述width值小于移动终端的屏幕宽度值,但大于移动终端的屏幕宽度值的二分之一,则将该图像元素的位置属性值修改为居中显示;The third modification subunit is used to compare the width value of the image element with the screen width value of the mobile terminal when the page element currently being parsed is an image element, if the width value is greater than the screen width value of the mobile terminal, Then according to the ratio between the width value and the screen width of the mobile terminal, the width value is proportionally reduced; if the width value is less than the screen width value of the mobile terminal, but greater than half of the screen width value of the mobile terminal One, modify the value of the position attribute of the image element to display in the center;
或者,or,
第四修改子单元,用于如果所述当前正在解析的页面元素为超链接元素,并且所述超链接元素中包含img标签以及文本,则为所述img标签加入边界属性值;The fourth modification subunit is used to add boundary attribute values to the img tag if the page element currently being parsed is a hyperlink element, and the hyperlink element contains img tags and text;
或者,or,
第五修改子单元,用于如果所述当前正在解析的页面元素为分区元素,则为所述分区元素加入边界属性值。The fifth modification subunit is configured to add a boundary attribute value to the partition element if the page element currently being parsed is a partition element.
其中,所述渲染树构造单元包括:Wherein, the rendering tree construction unit includes:
第一属性去掉子单元,用于将所述当前正在解析的页面元素包含的宽度高度的绝对属性、定位属性、背景图属性和/或与文本显示相关的属性去掉;The first attribute removes subunits, which are used to remove the absolute attributes of width and height contained in the page element currently being parsed, positioning attributes, background image attributes and/or attributes related to text display;
和/或,and / or,
第二属性去掉子单元,用于将元素盒模型中的边框与填充属性去掉。The second attribute removes the subunit, which is used to remove the border and padding attributes in the element box model.
其中,还包括:Among them, also include:
文本颜色修改单元,用于如果将所述当前正在解析的页面元素的背景图去掉,修改所述页面元素中包含的文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。The text color modifying unit is configured to modify the color attribute value of the text contained in the page element if the background image of the page element currently being parsed is removed, so as to ensure the recognition of the text after the background image is removed.
其中,所述文本颜色修改单元包括:Wherein, the text color modification unit includes:
第一颜色修改子单元,用于如果页面元素内文本颜色是白色,则设置所述文本颜色为网页文本默认颜色;The first color modification subunit is used to set the text color as the default color of the webpage text if the text color in the page element is white;
或者,or,
第二颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色不透明,则设置文本颜色为所述元素背景色具有预置色差值的颜色;The second color modification subunit is used to set the text color as the color of the background color of the element with a preset color difference value if the text color in the web page element is not white and the background color of the element is opaque;
或者,or,
第三颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色透明,则设置文本颜色为与此网页的主体元素的背景色具有预置色差值的颜色。The third color modification subunit is used to set the text color to a color with a preset color difference value from the background color of the main element of the webpage if the text color in the webpage element is not white and the background color of the element is transparent.
根据本发明提供的具体实施例,本发明达到了以下技术效果:如果当前页面元素对应的标签影响排版,则对影响排版的标签进行处理,以消除所述标签对排版的影响,通过对标签的处理可以避免标签对应的页面元素对排版的影响;根据处理后的标签构造渲染树的节点,并且,如果存在影响排版的层叠样式表CSS属性,则将所述影响排版的CSS属性去掉,以便按照构造的渲染树在移动终端中对网页内容进行绘制并显示,将影响排版的CSS属性去掉,可以避免CSS属性的设置而使得页面元素的显示效果影响排版。其中对标签的处理包括对标签对应的CSS属性的修改,例如将其宽度的绝对属性修改为相对属性,因此使得网页排版可以根据客户端屏幕大小来适配不同的客户端。同时,本发明实施例中只是将影响排版的标签CSS属性进行处理,以及去掉影响排版的CSS属性,而不用将为页面元素所设计的所有CSS样式去掉,因此,可以从一定程度上保留一些应有的画面效果,保证网页显示的生动性。According to the specific embodiment provided by the present invention, the present invention achieves the following technical effect: if the tag corresponding to the current page element affects the typesetting, then process the tag that affects the typesetting, so as to eliminate the impact of the tag on the typesetting. The processing can avoid the impact of the page element corresponding to the tag on the typesetting; construct the node of the rendering tree according to the processed tag, and if there is a cascading style sheet CSS attribute that affects the typesetting, remove the CSS attribute that affects the typesetting, so as to follow the The constructed rendering tree draws and displays the content of the webpage in the mobile terminal, and removes the CSS attributes that affect the typesetting, which can avoid the setting of the CSS attributes and make the display effect of the page elements affect the typesetting. The processing of the label includes modifying the corresponding CSS property of the label, such as changing the absolute property of its width to a relative property, so that the webpage layout can be adapted to different clients according to the size of the client screen. At the same time, in the embodiment of the present invention, only the label CSS attributes that affect layout are processed, and the CSS attributes that affect layout are removed, instead of removing all CSS styles designed for page elements. Therefore, some application elements can be retained to a certain extent. Some picture effects ensure the vividness of web page display.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本发明实施例提供的方法的流程图;Fig. 1 is the flowchart of the method provided by the embodiment of the present invention;
图2是本发明实施例提供的第一装置的示意图;Fig. 2 is a schematic diagram of a first device provided by an embodiment of the present invention;
图3是本发明实施例提供的第二装置的示意图;Fig. 3 is a schematic diagram of a second device provided by an embodiment of the present invention;
图4是本发明实施例提供的第三装置的示意图;Fig. 4 is a schematic diagram of a third device provided by an embodiment of the present invention;
图5是本发明实施例提供的第四装置的示意图。Fig. 5 is a schematic diagram of a fourth device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention belong to the protection scope of the present invention.
S101:接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;S101: Receive a request for accessing a webpage through a mobile terminal, and obtain resources corresponding to the webpage from a webpage server according to the request;
首先需要说明的是,当前的网页浏览器大概分成两种类型:客户端直接嵌入浏览器和C/S(客户端/代理服务器)架构浏览器。其中,前者是直接通过浏览器访问网页,也即,浏览器在接收到用户访问某网页的请求之后,直接将该请求发送到网页服务器,获取网页服务器返回的网页数据后,在本地进行解析和渲染,最终进行显示;后者是将浏览器分为客户端和服务端两部分,其中客户端在用户终端上运行,服务端在远程服务器上运行,客户端在接收到用户访问网页的请求之后,首先将请求发送给自己的服务端,然后由服务端访问网页服务器,在获取到网页服务器返回的网页数据后,在服务端进行解析和渲染计算,然后通过私有协议将计算的结果发送给客户端,由客户端根据计算结果显示在用户终端上,相当于所有的交互都是在服务端的协助下完成的。本发明实施例可以适用于上述任何一种情况。First of all, it needs to be explained that the current web browsers are roughly divided into two types: the client directly embedded in the browser and the C/S (client/proxy server) architecture browser. Among them, the former is to directly access the webpage through the browser, that is, after the browser receives the user's request to visit a certain webpage, it directly sends the request to the webpage server, and after obtaining the webpage data returned by the webpage server, it performs parsing and processing locally. Rendering, and finally displaying; the latter is to divide the browser into two parts, the client and the server, where the client runs on the user terminal, and the server runs on the remote server. After the client receives the user's request to access the webpage , first send the request to its own server, and then the server accesses the web server, after obtaining the web page data returned by the web server, parses and renders calculations on the server, and then sends the calculated results to the client through a private protocol end, and the client displays the calculation results on the user terminal, which means that all interactions are completed with the assistance of the server. The embodiments of the present invention may be applicable to any of the foregoing situations.
网页服务器在接受到移动终端,如手机,PAD(Personal DigitalAssistant,个人助理)等,发送的访问网页的http请求时,会返回所述的网页资源,但是现有的网页排版和显示大多数都是针对传统的PC(personalcomputer,个人电脑)显示屏,因此,通过移动终端访问网页时,需要对所述的网页内容进行窄排适配,否则会使得网页内容在移动终端中显示时出现文本内容溢出屏幕或者其它不适配的情况。移动终端在发送访问网页请求时,请求信息中可以包含其分辨率信息,因此,可以通过解析请求信息,根据移动终端的分辨率信息进行相应的窄排适配。另外,对于手机浏览器来说,也可以是服务器端预先保存各型号手机的分辨率信息,此时,只需获取手机的型号,根据各型号手机对应的分辨率信息进行相应的窄排适配。When the web server receives an http request for accessing web pages from a mobile terminal, such as a mobile phone, PAD (Personal Digital Assistant, personal assistant), etc., it will return the web page resource, but most of the existing web page layout and display are For the traditional PC (personal computer, personal computer) display screen, therefore, when accessing the webpage through the mobile terminal, the webpage content needs to be narrowly adapted, otherwise the text content will overflow when the webpage content is displayed on the mobile terminal screen or other unsuitable conditions. When the mobile terminal sends a webpage access request, the request information may include its resolution information. Therefore, by parsing the request information, corresponding narrow row adaptation may be performed according to the resolution information of the mobile terminal. In addition, for mobile browsers, the resolution information of each model of mobile phone can also be stored in advance on the server side. At this time, only the model of the mobile phone is obtained, and the corresponding narrow row adaptation is performed according to the resolution information corresponding to each model of mobile phone. .
S102:在对所述网页资源中包含的页面元素进行解析,并生成对应的渲染树节点的解析过程中,判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理,以消除所述标签对排版的影响;S102: During the parsing process of parsing the page elements contained in the webpage resources and generating the corresponding rendering tree nodes, it is judged whether the label corresponding to the current page element affects the typesetting, if there is a label that affects the typesetting, the Tags that affect typesetting are processed to eliminate the impact of the tags on typesetting;
为了便于理解此步骤,先简单介绍一下CSS(Cascading Style Sheet,层叠样式表单)。CSS是一种用来表现HTML(Hypertext Markup Language,超文本标记语言)或XML等文件式样的计算机语言,可以用来进行网页风格的设计。例如想要使链接字未点击时是蓝色的,当鼠标移动上去后变成红色且有下划线,这就是一种风格。此种风格的实现可以通过对相应元素的CSS属性的设置来实现。In order to facilitate understanding of this step, let's briefly introduce CSS (Cascading Style Sheet, Cascading Style Sheet). CSS is a computer language used to represent file styles such as HTML (Hypertext Markup Language) or XML, and can be used to design web pages. For example, if you want to make the link word blue when it is not clicked, it will turn red and underlined when the mouse is moved up. This is a style. The realization of this style can be realized by setting the CSS property of the corresponding element.
目前利用CSS来控制HTML页面的显示效果有以下几种方式:Currently, CSS is used to control the display effect of HTML pages in the following ways:
1)行内方式,可以直接对HTML标签适用style=" "来实现。1) The inline method can be realized by directly applying style=" " to HTML tags.
2)内嵌方式,就是将CSS代码写在<head></head>之间,并用<style></style>进行申明。2) The embedded method is to write the CSS code between <head> and </head>, and declare it with <style></style>.
3)链接方式,只需在<head></head>之间加上一个链接,将该链接的herf属性值设置为外部CSS文件名。这种方式实现了HTML文件和CSS文件的彻底分离,使得前期制作和后期维护都十分方便。如果要保持页面风格统一,只要把这些公共的CSS文件单独保存成一个文件,其它的页面就可以分别调用需要的CSS文件,如需要改变网页风格,只需要修改公共的CSS文件就可以实现。3) In the link method, just add a link between <head> and </head>, and set the herf attribute value of the link as the name of the external CSS file. This method realizes the complete separation of HTML files and CSS files, making pre-production and post-maintenance very convenient. If you want to maintain a unified page style, you only need to save these public CSS files as a single file, and other pages can call the required CSS files separately. If you need to change the web page style, you only need to modify the public CSS file.
4)导入方式,导入方式和链接样式比较相似,采用improt方式导入CSS样式表,在HTML初始化时,会被导入到HTML文件中,成为文件的一部分。4) Import method. The import method is similar to the link style. The import method is used to import the CSS style sheet. When the HTML is initialized, it will be imported into the HTML file and become a part of the file.
由于通过链接方式来实现CSS对HTML页面显示效果的控制,操作方便,同时也便于管理和维护,因此,目前多数网站都使用链接方式来控制页面显示效果。Because the control of CSS on the display effect of HTML pages is realized through links, the operation is convenient, and it is also convenient for management and maintenance. Therefore, most websites currently use links to control the display effects of pages.
另外,为了便于理解,再简单介绍一下渲染引擎的基本工作流程。渲染引擎的基本工作流程为:构建Dom树、构建Render树、布局Render树、绘制Render树。渲染引擎获取到HTML页面资源后,开始解析HTML页面内容,并将其中的标签转化为Dom树节点,并构建Dom树。接着它开始解析CSS文件及style标签中的样式信息,这些获取到的样式信息和HTML页面中的可见性指令将被用来构建Render树。Render树是对Dom树的更进一步的描述,由元素显示序列中的可见元素组成,它是文档的可视化表示,构建这棵树是为了以正确的顺序绘制文档内容。渲染对象和Dom元素相对应,但这种对应关系不一定是一对一的,不可见的Dom元素不会被插入渲染树,例如head元素。另外,display属性为none的元素也不会在渲染树中出现。处理html和body标签将构建渲染树的根,这个根渲染对象对应被css规范称为containing block的元素——包含了其他所有块元素的顶级块元素。它的大小就是viewport——浏览器窗口的显示区域,Firefox称它为viewPortFrame,webkit称为RenderView,这个就是文档所指向的渲染对象,树中其他的部分都将作为一个插入的Dom节点被创建。In addition, for the sake of understanding, briefly introduce the basic workflow of the rendering engine. The basic workflow of the rendering engine is: building the Dom tree, building the Render tree, laying out the Render tree, and drawing the Render tree. After the rendering engine obtains the HTML page resource, it starts to parse the HTML page content, converts the tags in it into Dom tree nodes, and builds the Dom tree. Then it starts to parse the CSS file and the style information in the style tag, and the acquired style information and visibility instructions in the HTML page will be used to build the Render tree. The Render tree is a further description of the Dom tree. It is composed of visible elements in the element display sequence. It is a visual representation of the document. This tree is constructed to draw the content of the document in the correct order. Rendering objects correspond to Dom elements, but this correspondence is not necessarily one-to-one. Invisible Dom elements will not be inserted into the rendering tree, such as the head element. In addition, elements whose display attribute is none will not appear in the rendering tree. Processing the html and body tags will build the root of the render tree, which corresponds to what the CSS specification calls a containing block element—the top-level block element that contains all other block elements. Its size is viewport—the display area of the browser window. Firefox calls it viewPortFrame, and webkit calls it RenderView. This is the rendering object pointed to by the document. The rest of the tree will be created as an inserted Dom node.
在渲染树中,每个节点(渲染对象)都有其对应的样式,因此创建渲染树需要计算出每个渲染对象的可视属性,这可以通过计算每个元素的样式属性得到。样式包括各种来源的样式表,行内样式元素及html中的可视化属性(例如bgcolor),可视化属性转化为css样式属性。样式表来源于浏览器默认样式表,及页面作者和用户提供的样式表——有些样式是浏览器用户提供的(浏览器允许用户定义喜欢的样式,例如,在Firefox中,可以通过在FirefoxProfile目录下放置样式表实现。In the rendering tree, each node (rendering object) has its corresponding style, so creating the rendering tree needs to calculate the visual attribute of each rendering object, which can be obtained by calculating the style attribute of each element. Styles include style sheets from various sources, inline style elements and visual attributes in html (such as bgcolor), and visual attributes are converted into css style attributes. The style sheet comes from the default style sheet of the browser, as well as the style sheet provided by the page author and the user - some styles are provided by the browser user (the browser allows the user to define the favorite style, for example, in Firefox, you can pass in the FirefoxProfile directory Place the stylesheet implementation below.
本发明实施例就是在渲染引擎生成渲染树阶段,通过修改页面元素的CSS属性,实现了计算出的页面元素的样式可以适配在不同尺寸的移动终端屏幕上的效果。具体修改页面元素的属性是针对webkit中的类RenderStyle来进行的。因为此类中各成员即对应CSS的各种样式。下面进行详细说明。The embodiment of the present invention achieves the effect that the calculated styles of the page elements can be adapted to different sizes of mobile terminal screens by modifying the CSS properties of the page elements at the rendering engine generation rendering tree stage. The specific modification of the properties of the page elements is carried out for the class RenderStyle in webkit. Because each member of this class corresponds to various styles of CSS. Detailed description will be given below.
在浏览器渲染引擎构建渲染树阶段,将会获取页面元素的CSS样式信息。但是,此时获取的CSS样式信息并不能直接套用到移动终端,因为现有的网页主要是针对PC显示屏,因此其中的一些页面元素的CSS样式并不适合移动终端显示,所以,在获取到页面元素的CSS样式信息后,如果当前页面元素对应的标签影响排版,则需要对影响排版的标签进行处理,以消除所述标签对排版的影响。其中,所述的影响排版的标签包括表格及相关的子标签(包括表格头、表格体、表格行)、表单输入控件、下拉菜单/列表、文本域、图像、超链接、分区,普通卷动、包含对象、嵌入元素、下标、上标,内联框架等等。具体在对这些标签进行处理时,可以针对不同的情况进行不同的处理,例如,其中一种处理方式可以是:针对一些特殊的标签,在对影响排版的标签进行处理时,还可以采用直接将这种影响排版的标签去掉的方式,也就是说,保留当前的页面元素,但是将原来为该元素设定的标签去掉,使得该元素不再显示成原来的标签所设定的样式。具体去掉的方式可以是,将该标签的disply属性设置为none。例如:In the stage of building the rendering tree by the browser rendering engine, the CSS style information of the page elements will be obtained. However, the CSS style information obtained at this time cannot be directly applied to the mobile terminal, because the existing web pages are mainly aimed at PC display screens, so the CSS styles of some of the page elements are not suitable for display on the mobile terminal. After the CSS style information of the page element, if the label corresponding to the current page element affects the layout, the label that affects the layout needs to be processed to eliminate the impact of the label on the layout. Wherein, the tags that affect typesetting include tables and related sub-tags (including table headers, table bodies, table rows), form input controls, drop-down menus/lists, text fields, images, hyperlinks, partitions, ordinary scrolling , containing objects, embedded elements, subscripts, superscripts, inline frames, and more. Specifically, when processing these tags, different processing can be carried out according to different situations. For example, one of the processing methods can be: for some special tags, when processing tags that affect typesetting, you can also directly use the This method of removing tags that affect typesetting means that the current page element is retained, but the tag originally set for the element is removed, so that the element no longer displays the style set by the original tag. The specific removal method can be to set the display attribute of the tag to none. For example:
(1)普通卷动(marquee)(1) Ordinary scrolling (marquee)
Marquee标签是用来控制字体滚动的。因为部分手机客户端不支持marquee的滚动功能,或者支持的效果不太好,为了不影响排版效果,可以通过处理该标签的显示属性,去掉该标签。去掉标签之后,标签内的内容在网页中显示时将不再有滚动的效果。Marquee tags are used to control font scrolling. Because some mobile clients do not support the marquee scrolling function, or the support effect is not very good, in order not to affect the typesetting effect, you can remove the tag by processing the display attribute of the tag. After the label is removed, the content in the label will no longer have the effect of scrolling when displayed on the web page.
(2)下标(sub)、上标(sup)(2) subscript (sub), superscript (sup)
Sub用来定义下标文本,包含在标签内的文本在基线以下按正常文本高度的一半来显示。sup用来定义上标文本,包含在标签内的文本在基线以上按正常文本高度的一半来显示。这两个角标元素会造成整体排版不整齐,元素布局混乱,所以如果页面中存在以上标签,可以将标签去掉。去掉标签后,角标标签内的内容可以按照普通文本的样式显示,即与普通文本处于同一基线,字体信息一致。Sub is used to define subscript text, and the text contained in the label is displayed at half the normal text height below the baseline. sup is used to define superscript text, and the text contained in the label is displayed at half the normal text height above the baseline. These two corner mark elements will cause the overall layout to be irregular and the layout of elements to be chaotic, so if the above tags exist on the page, they can be removed. After the label is removed, the content in the corner mark label can be displayed in the style of ordinary text, that is, it is on the same baseline as ordinary text, and the font information is consistent.
另外,对影响排版的标签进行处理还可以是将标签对应的当前页面元素去掉。例如,如果当前正在解析的页面元素为前述普通卷动元素、下标元素或上标元素,则直接将这种页面元素去掉。也就是说,在渲染树中不再存在该页面元素对应的节点,进而在网页中也就不会再绘制并显示该页面元素,显然,也就可以消除该页面元素对排版的影响。In addition, processing the tags that affect typesetting may also be removing the current page element corresponding to the tags. For example, if the page element currently being parsed is the aforementioned common scrolling element, subscript element or superscript element, such page element is directly removed. That is to say, the node corresponding to the page element no longer exists in the rendering tree, and the page element will no longer be drawn and displayed in the web page. Obviously, the influence of the page element on typesetting can also be eliminated.
当然,具体实现时,除了上述普通卷动元素、下标元素或上标元素可以直接去掉之外,包含对象(object)、嵌入(embed)的页面元素也可以直接去掉。其中,object和embed嵌入元素都是用来向页面中添加多媒体文件,如音频、视频、flash等。object标签是用于windows平台的IE浏览器的,而embed是用于windows和Macintosh平台下的Netscape Navigator浏览器以及Macintosh平台下的IE浏览器。一般为了确保大多数浏览器能正常显示flash,需要把embed标签嵌套放在object标签内。支持Activex控件的浏览器将会忽略object标签内的embed标签。Netscape和使用插件的IE浏览器将只读取embed标签而不会识别object标签。例如,<objectclassid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1"width="100"height="50"></object>,其中,classid用于定义嵌入网页中的类的ID值,此属性可用来指定浏览器中包含的对象的位置,通常是一个Java类。但是目前大多数的手机浏览器不支持flash动画,如果页面中包含上述的两个元素,为了不影响排版效果,则可以去掉这种页面元素。将这种页面元素去掉后,网页内将不再显示具体的视频、音频、flash等元素。Of course, in actual implementation, in addition to the above-mentioned ordinary scroll elements, subscript elements or superscript elements can be directly removed, page elements including objects (object) and embedded (embed) can also be directly removed. Among them, the object and embed embedded elements are used to add multimedia files, such as audio, video, flash, etc., to the page. The object tag is used for the IE browser on the Windows platform, and the embed is used for the Netscape Navigator browser on the Windows and Macintosh platforms and the IE browser on the Macintosh platform. Generally, in order to ensure that most browsers can display flash normally, it is necessary to nest the embed tag in the object tag. Browsers that support ActiveX controls will ignore the embed tag inside the object tag. Netscape and IE browsers using plug-ins will only read the embed tag and will not recognize the object tag. For example, <objectclassid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1"width="100"height="50"></object>, where classid is used to define the class embedded in the web page The ID value, this attribute can be used to specify the location of the object contained in the browser, usually a Java class. However, currently most mobile browsers do not support flash animation. If the above two elements are included in the page, such page elements can be removed in order not to affect the typesetting effect. After such page elements are removed, specific video, audio, flash and other elements will no longer be displayed in the webpage.
另外,对标签的处理还可以是将影响排版的标签中定义的CSS属性值进行修改,也就是说,保留当前的页面元素及其标签,但需要对标签中为该元素定义的属性值进行修改,以使得该标签不再影响排版。例如,具体实现时可以针对以下各类元素的标签分别进行属性值的修改:In addition, the processing of the label can also be to modify the CSS attribute value defined in the label that affects the layout, that is to say, the current page element and its label are retained, but the attribute value defined for the element in the label needs to be modified. , so that the tag no longer affects typography. For example, during specific implementation, attribute values can be modified separately for the tags of the following types of elements:
(1)表格(table)及相应的内联元素(th、td、tr)(1) Table (table) and corresponding inline elements (th, td, tr)
网页设计者经常会使用表格来使得页面格局整齐有序,一个表格内通常会有多列多行,而行宽通常是适应PC显示屏幕的,因此对于移动终端显示屏幕来说,就会出现表格行宽大于屏幕宽度的情况,由于表格单元无法自动换行,进而使得部分表格内容溢出屏幕。因此,如果当前正在解析的页面元素为表格元素时,可以通过CSS选择器对表格元素及表格元素的内联元素的层叠样式表属性进行相应的修改,使得表格内容可以自动换行,从而适应不同尺寸大小的屏幕。Web designers often use tables to make the page layout neat and orderly. There are usually multiple columns and multiple rows in a table, and the row width is usually adapted to the PC display screen. Therefore, for the mobile terminal display screen, there will be a table When the row width is larger than the screen width, some table content overflows the screen because the table cells cannot wrap automatically. Therefore, if the page element currently being parsed is a table element, the CSS selector can be used to modify the cascading style sheet properties of the table element and the inline element of the table element accordingly, so that the table content can automatically wrap to adapt to different sizes size of the screen.
(2)表单输入控件(input)、下拉菜单/列表(select)、文本域(textarea)或内联框架(iframe)(2) Form input control (input), drop-down menu/list (select), text area (textarea) or inline frame (iframe)
表单输入控件(Input)表示Form表单的一种输入对象,其又随Type类型的不同而分为文本输入框,密码输入框,单选/复选框,提交/重置按钮等。下拉菜单/列表(Select)元素可创建单选或多选菜单。文本域(textarea)是定义多行的文本输入控件,文本区中可容纳无限数量的文本。iframe元素会创建包含另外一个文档的内联框架(即行内框架)。Form input control (Input) represents an input object of the Form form, which is divided into text input box, password input box, radio/check box, submit/reset button, etc. according to the type. The drop-down menu/list (Select) element creates a single-select or multi-select menu. A text area (textarea) is a text input control that defines multiple lines, and an unlimited number of texts can be accommodated in the text area. The iframe element creates an inline frame (ie, an inline frame) that contains another document.
如果当前正在解析的页面元素为以上所述的任一或多个元素,并且元素的宽度属性为绝对数值时,则将宽度修改为相对宽度,其属性值为100%,使得其内容可以占满手机屏幕宽度。因为绝对值宽度可能会带来屏幕留白或者折行问题,给排版造成影响。例如,在默认的情况下,iframe的宽度是300px,当移动终端屏幕宽度大于300px的时候,就会出现屏幕右侧大幅空白,因此,可以将iframe的宽度属性修改为相对宽度,属性值为100%。此时iframe内文本内容可以始终占满屏幕。If the page element currently being parsed is any one or more elements mentioned above, and the width attribute of the element is an absolute value, then modify the width to a relative width, and its attribute value is 100%, so that its content can fill up Phone screen width. Because the absolute value width may cause screen blanking or line folding problems, which will affect the layout. For example, by default, the width of the iframe is 300px. When the screen width of the mobile terminal is greater than 300px, there will be a large blank on the right side of the screen. Therefore, you can modify the width attribute of the iframe to a relative width, and the attribute value is 100 %. At this time, the text content in the iframe can always fill the screen.
(3)图像(img)(3) Image (img)
Img元素用来在网页中插入一幅图片,该元素的width属性,是用于指定图片插入网页后显示的宽度,该宽度可能会影响到排版,因此,如果当前正在解析的页面元素为图像元素时也需要进行修改。具体的,可以首先获取到图像元素的width值,将其与移动终端的屏幕宽度值做对比,当width值大于移动终端的屏幕宽度时,将width值进行与屏幕大小等比例的缩放,具体操作可以为setstyle(Length(Auto)),使其能根据屏幕大小正常显示。如果图片宽度没有超出屏幕宽度,但是超过屏幕宽度的二分之一,可以将其位置属性值修改为居中显示,使其能在移动终端屏幕上居中显示。The Img element is used to insert an image into a web page. The width attribute of this element is used to specify the width displayed after the image is inserted into the web page. This width may affect the layout. Therefore, if the page element currently being parsed is an image element also need to be modified. Specifically, you can first obtain the width value of the image element, and compare it with the screen width value of the mobile terminal. When the width value is greater than the screen width of the mobile terminal, scale the width value in proportion to the screen size. The specific operation It can be setstyle(Length(Auto)), so that it can be displayed normally according to the screen size. If the width of the picture does not exceed the screen width, but exceeds one-half of the screen width, you can modify its position attribute value to display in the center, so that it can be displayed in the center on the screen of the mobile terminal.
(4)超链接(a)(4) hyperlink (a)
在a标签中,可以插入img标签,此时img标签中插入的图片就成为图像超链接,点击图片的任何一部分都可以打开该超链接。为了避免该图片与标签对应的其他文本在显示时相重叠,为所述img标签加入边界属性值(margin),同时为了避免两个相邻的超链接连接到一起,可以为a标签设置边界属性。margin这个简写属性可以设置一个元素所有外边距的宽度,或者设置各边上外边距的宽度。In the a tag, an img tag can be inserted, and the picture inserted in the img tag becomes an image hyperlink, and clicking any part of the picture can open the hyperlink. In order to prevent the picture from overlapping with other text corresponding to the label when displayed, add a border attribute value (margin) to the img tag, and in order to prevent two adjacent hyperlinks from being connected together, you can set the border attribute for the a tag . The margin shorthand attribute can set the width of all margins of an element, or set the width of margins on each side.
(5)分区(div)(5) Partition (div)
DIV元素是用来为HTML文档内大块(block-level)的内容提供结构和背景的元素。DIV的起始标签和结束标签之间的所有内容都是用来构成这个块的,其中所包含元素的特性由DIV标签的属性来控制,或者是通过使用样式表格式化这个块来进行控制。如果当前正在解析的页面元素为分区元素,为了避免父子和兄弟分区之间的边框重叠,可以为每一个div元素设置margin属性。The DIV element is an element used to provide structure and background to block-level content within an HTML document. Everything between the start and end tags of the DIV is used to form the block, and the properties of the contained elements are controlled by attributes of the DIV tag, or by formatting the block using a style sheet. If the page element currently being parsed is a partition element, in order to avoid overlapping borders between parent-child and sibling partitions, you can set the margin attribute for each div element.
需要说明的是,对于移动终端所要访问的网页来说,不一定会包含全部上述所说的影响排版的标签,有可能只包含其中的一个或多个。因此,在具体实施的过程中,可以根据不同页面的实际情况,对页面内出现的一个或多个上述影响排版的标签进行处理。It should be noted that, for a webpage to be accessed by a mobile terminal, it may not necessarily contain all the above-mentioned tags that affect typesetting, and may only contain one or more of them. Therefore, in the process of specific implementation, one or more above-mentioned tags that affect typesetting can be processed according to the actual situation of different pages.
S103:根据处理后的标签构造渲染树的节点,并且,如果判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除将所述影响排版的CSS属性去掉,以便之后按照构造的渲染树在移动终端中对网页内容进行绘制并显示。S103: Construct the nodes of the rendering tree according to the processed tags, and if it is judged whether there is a CSS attribute that affects layout, if there is a CSS attribute that affects layout, remove the CSS attribute that affects layout. , so that the web page content can be drawn and displayed in the mobile terminal according to the constructed rendering tree.
渲染引擎在生成渲染树时,对于每个节点都需要计算其对应的样式,也即需要将获取的CSS样式属性值应用到对应的节点。由于有些页面元素的CSS属性也会影响到排版,因此在此计算样式的过程中,需要将这些相应的属性去掉,不将其应用到对应的节点上,以消除该属性对排版的影响。其中,这些影响排版的属性可以包括:宽高的绝对值属性、元素盒模型中的边框与填充属性、设置背景图的属性、与文本显示相关的属性。在本实施例中对这些属性的处理具体为:When the rendering engine generates the rendering tree, it needs to calculate its corresponding style for each node, that is, it needs to apply the obtained CSS style attribute value to the corresponding node. Since the CSS properties of some page elements can also affect the layout, in the process of calculating the style, these corresponding properties need to be removed and not applied to the corresponding nodes, so as to eliminate the impact of the properties on the layout. Among them, these attributes that affect typesetting may include: absolute value attributes of width and height, border and padding attributes in the element box model, attributes for setting background images, and attributes related to text display. In this embodiment, the processing of these attributes is specifically:
(1)宽高的绝对属性(1) Absolute properties of width and height
对于绝对值给定的宽高属性(width、min-width、max-width、height、min-height、max-height、size),会使页面内容在适配手机屏幕时出现不成比例或者是溢出手机屏幕的现象。例如,原网页中某些元素的CSS属性中宽度值为给定的绝对值,假设其宽度属性值为width:320px,由于其给定的是绝对值,因此,对于任何浏览器在解析后都将其理解为宽度是320px,那么对于屏幕宽度小于320px的显示器来说,就会出现内容溢出屏幕的现象。因此为了不影响排版,需将以上所述的宽高相关的绝对值属性过滤掉。For the width and height attributes given by absolute values (width, min-width, max-width, height, min-height, max-height, size), the content of the page will appear disproportionate or overflow the phone when it is adapted to the phone screen screen phenomenon. For example, the width value of the CSS attribute of some elements in the original web page is a given absolute value, assuming that the value of the width attribute is width:320px, since the given value is an absolute value, for any browser after parsing It is understood that the width is 320px, then for a display with a screen width smaller than 320px, the content will overflow the screen. Therefore, in order not to affect the typesetting, it is necessary to filter out the above-mentioned absolute value attributes related to width and height.
(2)元素盒模型中的边界(margin)与填充(padding)属性(2) Margin and padding attributes in the element box model
CSS会将所有的网页元素都看做是一个矩形框,这些框由元素的内容、填充、边框(border)和边界组成。填充是元素的内容与边框之间的空间。边界是一个元素与另一个元素之间的间隔。元素的边界和填充属性会造成网页中文本内容折行和屏幕遗留空白的问题,因此需要将这些属性过滤掉。CSS treats all web page elements as a rectangular box consisting of the element's content, padding, border, and border. Padding is the space between an element's content and its border. A border is the space between one element and another. The border and padding properties of elements will cause the text content in the web page to wrap and leave blank space on the screen, so these properties need to be filtered out.
(3)定位属性(3) Positioning attributes
与元素的位置相关的属性(position,center,align,left,right,bottom,top,text-align),会使得页面元素在与手机屏幕相适配的过程出现位置显示不恰当或者溢出手机屏幕的现象,给排版造成很大问题,因此需要将这些属性过滤掉。Attributes related to the position of the element (position, center, align, left, right, bottom, top, text-align) will cause the page element to display inappropriately or overflow the mobile phone screen during the process of adapting to the mobile phone screen Phenomena, causing great problems for typesetting, so these attributes need to be filtered out.
(4)背景图属性(4) Background image properties
背景图(background-image)属性为元素设置背景图像。元素的背景占据了元素的全部尺寸,包括内边距和边框,但不包括外边距。默认地,背景图像位于元素的左上角,并在水平和垂直方向上重复。The background-image attribute sets the background image for the element. The element's background takes up the full size of the element, including padding and borders, but excluding margins. By default, the background image is placed in the upper left corner of the element and is repeated horizontally and vertically.
在对手机屏幕适配的过程中,由于无法处理大背景图的切割和小背景图的重复,因此将background-image属性过滤掉。由于去掉了背景图,因此会造成颜色与背景色相同的文本无法显示,所以还可以重新设置文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。具体实施时可以是:如果页面元素内文本颜色是白色,则设置文本颜色为网页文本默认颜色;如果网页元素内文本颜色不是白色,并且元素背景色不透明,则设置文本颜色为与元素背景色具有一定色差值的颜色;如果网页元素内文本颜色不是白色,并且元素的背景色透明,则设置文本颜色为与此网页的主体元素(body元素)的背景色具有一定色差值的颜色。其中,具体的色差值可以是根据经验值等预先设置的。In the process of adapting to the mobile phone screen, the background-image attribute is filtered out because the cutting of the large background image and the repetition of the small background image cannot be handled. Since the background image is removed, the text with the same color as the background color cannot be displayed, so the color attribute value of the text can also be reset to ensure the recognition of the text after the background image is removed. The specific implementation can be: if the text color in the page element is white, then set the text color to the default color of the webpage text; if the text color in the webpage element is not white, and the background color of the element is opaque, then set the text color to have the same color as the background color of the element The color of a certain color difference value; if the text color in the webpage element is not white, and the background color of the element is transparent, set the text color to a color with a certain color difference value from the background color of the main element (body element) of the webpage. Wherein, the specific color difference value may be preset based on empirical values or the like.
(5)与文本显示相关的属性(5) Attributes related to text display
文本自动换行(word-wrap)属性用来控制当前行超过指定容器的边界时是否断开转行,默认值为允许内容顶开指定的容器边界,如果选择属性值为break-word,则内容将在边界内换行。text-indent属性用来控制文本块中首行文字缩进。这些与文本显示相关的属性都会造成网页中文字的折行和遗留空白的问题,因此需要过滤掉这些属性。The word-wrap attribute is used to control whether the current line breaks and wraps when it exceeds the boundary of the specified container. The default value is to allow the content to push the specified container boundary. If the selected attribute value is break-word, the content will be in the Line breaks within boundaries. The text-indent attribute is used to control the indentation of the first line of text in a text block. These attributes related to text display will cause the problems of line wrapping and blank spaces left in the webpage, so these attributes need to be filtered out.
具体在去掉影响排版的属性时,可以如下进行:对当前页面元素的所有属性进行轮询,轮询到某个需要去掉的属性时,直接进行回车操作,而不再为该属性赋予任何的属性值,这样就相当于去掉了该属性。Specifically, when removing the attributes that affect typesetting, you can proceed as follows: poll all the attributes of the current page element, and when a certain attribute that needs to be removed is polled, directly press Enter instead of assigning any attribute to the attribute attribute value, which is equivalent to removing the attribute.
经过对页面元素对应的标签进行处理后,由于去掉了影响排版的标签及页面元素或者重新设置了标签的CSS属性,同时对页面元素的影响排版的CSS属性进行了过滤,因此渲染及布局之后,移动终端所请求的网页内容就可以正常显示在其屏幕上,而不会出现不适配的情况。After processing the tags corresponding to the page elements, since the tags and page elements that affect the layout are removed or the CSS attributes of the tags are reset, and the CSS attributes that affect the layout of the page elements are filtered at the same time, after rendering and layout, The webpage content requested by the mobile terminal can be normally displayed on the screen without any incompatibility.
另外,为了使得html页面能够在手机上正常显示,现有技术还有如下实现方式:通过WAP转码服务器将HTML页面转换为WAP格式,由具备完整WAP解析能力的手机客户端完成排版和屏幕绘制,但是这样做使得原页面的JAVASCRIPT被过滤,原页面上依赖浏览器引擎解析JAVASCRIPT后才能支持的功能缺失。而本发明实施例中是对原HTML页面中的元素属性进行相应的适配处理,无需对原HTML页面进行精简。因此,原网页的JAVASCRIPT可以全部保留,无需做过滤处理,从而可以保证JAVASCRIPT的所有效果都可以在移动终端屏幕显示。In addition, in order to make the html page can be displayed normally on the mobile phone, the existing technology also has the following implementation method: the HTML page is converted to the WAP format through the WAP transcoding server, and the typesetting and screen drawing are completed by the mobile phone client with complete WAP analysis capability , but doing so causes the JAVASCRIPT of the original page to be filtered, and the functions that can only be supported after the browser engine parses JAVASCRIPT on the original page are missing. However, in the embodiment of the present invention, the element attributes in the original HTML page are correspondingly adapted, and the original HTML page does not need to be simplified. Therefore, all the JAVASCRIPT of the original webpage can be retained without filtering, thereby ensuring that all effects of the JAVASCRIPT can be displayed on the screen of the mobile terminal.
与本发明实施例提供的在移动终端中显示网页的方法相对应,本发明实施例还提供了一种在移动终端中显示网页的装置,参见图2,该装置可以包括:Corresponding to the method for displaying a webpage in a mobile terminal provided in the embodiment of the present invention, the embodiment of the present invention also provides a device for displaying a webpage in a mobile terminal. Referring to FIG. 2, the device may include:
资源获取单元201,用于接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;The resource obtaining unit 201 is configured to receive a request for accessing a webpage through a mobile terminal, and obtain resources corresponding to the webpage from a webpage server according to the request;
标签处理单元202,用于在对所述网页资源中包含的页面元素进行解析,解析过程中,判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理,以消除所述标签对排版的影响;The tag processing unit 202 is configured to analyze the page elements contained in the webpage resource, and during the parsing process, judge whether the tag corresponding to the current page element affects the typesetting, and if there is a tag that affects the typesetting, then the tag that affects the typesetting Tags are processed to eliminate the impact of said tags on typesetting;
渲染树构造单元203,用于根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树在移动终端中对网页内容进行绘制并显示。The rendering tree construction unit 203 is configured to construct the nodes of the rendering tree according to the processed tags, and judge whether there is a cascading style sheet CSS attribute that affects typesetting, and if there is a cascading style sheet CSS attribute that affects typesetting, then remove the CSS attribute that affects typesetting, Then draw and display the web page content in the mobile terminal according to the constructed rendering tree.
具体实现时,针对一些特殊的标签,参见图3,标签处理单元202可以包括:During specific implementation, for some special tags, referring to FIG. 3, the tag processing unit 202 may include:
标签去掉子单元2021,用于将影响排版的标签去掉,以便在根据处理后的标签构造渲染树的节点时,将该标签对应的页面元素作为普通文本处理。The tag removal subunit 2021 is configured to remove tags that affect typesetting, so that when the nodes of the rendering tree are constructed according to the processed tags, the page elements corresponding to the tags are treated as ordinary text.
其中,标签去掉子单元具体用于:如果所述当前正在解析的页面元素为普通卷动元素、下标元素或上标元素,则将这种页面元素的标签去掉。Wherein, the label removing subunit is specifically used for: if the page element currently being parsed is a common scroll element, a subscript element or a superscript element, then remove the label of this page element.
或者,参见图4,标签处理单元202也可以包括:Or, referring to FIG. 4, the tag processing unit 202 may also include:
元素去掉子单元2022,用于将当前页面元素去掉,以便在根据处理后的标签构造渲染树的节点时,不再生成该页面元素对应的节点。The element removal subunit 2022 is used to remove the current page element, so that when the node of the rendering tree is constructed according to the processed label, the node corresponding to the page element is no longer generated.
其中,元素去掉子单元具体可以用于:如果所述当前正在解析的页面元素为普通卷动元素、包含对象的元素、嵌入页面的元素、下标元素或上标元素,则将这种页面元素去掉。Wherein, the element removal subunit can be specifically used for: if the page element currently being parsed is a normal scrolling element, an element containing an object, an element embedded in a page, a subscript element or a superscript element, then the page element remove.
再者,参见图5,标签处理单元202还可以包括:Furthermore, referring to FIG. 5, the tag processing unit 202 may also include:
属性值修改子单元2023,用于将影响排版的标签中定义的CSS属性值进行修改;The attribute value modifying subunit 2023 is used to modify the CSS attribute value defined in the tag that affects layout;
相应的,渲染树构造单元203还可以用于:Correspondingly, the rendering tree construction unit 203 can also be used for:
利用修改后的CSS属性值为渲染树中该页面元素对应的节点的CSS属性进行赋值。The modified CSS property value is used to assign a value to the CSS property of the node corresponding to the page element in the rendering tree.
其中,所述属性值修改子单元具体可以包括:Wherein, the attribute value modifying subunit may specifically include:
第一修改子单元,用于当所述当前正在解析的页面元素为表格元素时,对表格元素及表格元素的内联元素的CSS值进行修改,以便所述表格元素能够自动换行;The first modification subunit is used to modify the CSS value of the table element and the inline element of the table element when the page element currently being parsed is a table element, so that the table element can wrap automatically;
或者,or,
第二修改子单元,用于当所述当前正在解析的页面元素为表单输入控件、下拉菜单/列表、文本域或内联框架元素,并且存在表示其宽度的绝对数值时,将所述绝对数值修改为相对数值;The second modification subunit is used to convert the absolute value to Modified to a relative value;
或者,or,
第三修改子单元,用于当所述当前正在解析的页面元素为图像元素时,比较该图像元素的width值与移动终端的屏幕宽度值,如果所述width值大于移动终端的屏幕宽度值,则按照所述width值与移动终端的屏幕宽度之间的比例,等比例缩小所述width值;如果所述width值小于移动终端的屏幕宽度值,但大于移动终端的屏幕宽度值的二分之一,则将该图像元素的位置属性值修改为居中显示;The third modification subunit is used to compare the width value of the image element with the screen width value of the mobile terminal when the page element currently being parsed is an image element, if the width value is greater than the screen width value of the mobile terminal, Then according to the ratio between the width value and the screen width of the mobile terminal, the width value is proportionally reduced; if the width value is less than the screen width value of the mobile terminal, but greater than half of the screen width value of the mobile terminal One, modify the value of the position attribute of the image element to display in the center;
或者,or,
第四修改子单元,用于如果所述当前正在解析的页面元素为超链接元素,并且所述超链接元素中包含img标签以及文本,则为所述img标签加入边界属性值;The fourth modification subunit is used to add boundary attribute values to the img tag if the page element currently being parsed is a hyperlink element, and the hyperlink element contains img tags and text;
或者,or,
第五修改子单元,用于如果所述当前正在解析的页面元素为分区元素,则为所述分区元素加入边界属性值。The fifth modification subunit is configured to add a boundary attribute value to the partition element if the page element currently being parsed is a partition element.
在实际应用中,渲染树构造单元203可以包括:In practical applications, the rendering tree construction unit 203 may include:
第一属性去掉子单元,用于将所述当前正在解析的页面元素包含的宽度高度的绝对属性、定位属性、背景图属性和/或与文本显示相关的属性去掉;The first attribute removes subunits, which are used to remove the absolute attributes of width and height contained in the page element currently being parsed, positioning attributes, background image attributes and/or attributes related to text display;
和/或,and / or,
第二属性去掉子单元,用于将元素盒模型中的边框与填充属性去掉。The second attribute removes the subunit, which is used to remove the border and padding attributes in the element box model.
其中,为了保证文本的可辨识度,该装置还可以包括:Wherein, in order to ensure the legibility of the text, the device may also include:
文本颜色修改单元,用于如果将所述当前正在解析的页面元素的背景图去掉,修改所述页面元素中包含的文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。The text color modifying unit is configured to modify the color attribute value of the text contained in the page element if the background image of the page element currently being parsed is removed, so as to ensure the recognition of the text after the background image is removed.
其中,文本颜色修改单元具体可以包括:Wherein, the text color modification unit may specifically include:
第一颜色修改子单元,用于如果页面元素内文本颜色是白色,则设置所述文本颜色为网页文本默认颜色;The first color modification subunit is used to set the text color as the default color of the webpage text if the text color in the page element is white;
或者,or,
第二颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色不透明,则设置文本颜色为所述元素背景色具有预置色差值的颜色;The second color modification subunit is used to set the text color as the color of the background color of the element with a preset color difference value if the text color in the web page element is not white and the background color of the element is opaque;
或者,or,
第三颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色透明,则设置文本颜色为与此网页的主体元素的背景色具有预置色差值的颜色。The third color modification subunit is used to set the text color to a color with a preset color difference value from the background color of the main element of the webpage if the text color in the webpage element is not white and the background color of the element is transparent.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。It can be seen from the above description of the implementation manners that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , CD, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present invention.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, It can be located in one place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上对本发明所提供的在移动终端中显示网页的方法及装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。The method and device for displaying web pages in the mobile terminal provided by the present invention have been described above in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for helping understanding The method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application range. In summary, the contents of this specification should not be construed as limiting the present invention.
根据本发明的实施例,公开了:According to the embodiments of the present invention, it is disclosed that:
A1、一种在移动终端中显示网页的方法,其特征在于,包括:A1, a method for displaying a webpage in a mobile terminal, is characterized in that, comprising:
接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;receiving a request for accessing a webpage through a mobile terminal, and obtaining resources corresponding to the webpage from a webpage server according to the request;
对所述网页资源中包含的页面元素进行解析,解析过程中判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理;Analyzing the page elements contained in the webpage resource, judging during the parsing process whether the label corresponding to the current page element affects the typesetting, if there is a label that affects the typesetting, then processing the label that affects the typesetting;
根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树对网页内容进行绘制并显示。Construct the nodes of the rendering tree according to the processed tags, and judge whether there is a cascading style sheet CSS attribute that affects the layout. If there is a cascading style sheet CSS attribute that affects the layout, remove the CSS attribute that affects the layout, and then follow the constructed rendering tree. The content is drawn and displayed.
A2、根据权利要求A1所述的方法,其特征在于,所述对所述影响排版的标签进行处理包括:A2. The method according to claim A1, wherein said processing the label that affects typesetting comprises:
将影响排版的标签去掉,以便在根据处理后的标签构造渲染树的节点时,将该标签对应的页面元素作为普通文本处理。Remove the tags that affect typesetting, so that when the nodes of the rendering tree are constructed based on the processed tags, the page elements corresponding to the tags are treated as ordinary text.
A3、根据权利要求A2所述的方法,其特征在于,所述将影响排版的标签去掉包括:A3, the method according to claim A2, is characterized in that, said removing the label that affects typesetting comprises:
如果所述当前正在解析的页面元素为普通卷动元素、下标元素或上标元素,则将这种页面元素的标签去掉。If the page element currently being parsed is a normal scrolling element, a subscript element or a superscript element, the tag of such page element is removed.
A4、根据权利要求A1所述的方法,其特征在于,所述对所述影响排版的标签进行处理包括:A4. The method according to claim A1, wherein said processing the label that affects typesetting comprises:
将当前页面元素去掉,以便在根据处理后的标签构造渲染树的节点时,不再生成该页面元素对应的节点。Remove the current page element, so that when the node of the rendering tree is constructed according to the processed label, the node corresponding to the page element is no longer generated.
A5、根据权利要求A4所述的方法,其特征在于,所述将当前页面元素去掉包括:A5. The method according to claim A4, wherein said removing the current page element comprises:
如果所述当前正在解析的页面元素为普通卷动元素、包含对象的元素、嵌入页面的元素、下标元素或上标元素,则将这种页面元素去掉。If the page element currently being parsed is a common scrolling element, an element containing an object, an element embedded in a page, a subscript element or a superscript element, such page element is removed.
A6、根据权利要求1所述的方法,其特征在于,所述对所述影响排版的标签进行处理包括:A6. The method according to claim 1, wherein said processing the label that affects typesetting comprises:
将影响排版的标签中定义的CSS属性值进行修改;Modify the CSS attribute value defined in the label that affects layout;
所述根据处理后的标签构造渲染树的节点包括:The nodes for constructing the rendering tree according to the processed labels include:
利用修改后的CSS属性值为渲染树中该页面元素对应的节点的CSS属性进行赋值。The modified CSS property value is used to assign a value to the CSS property of the node corresponding to the page element in the rendering tree.
A7、根据权利要求A6所述的方法,其特征在于,所述将影响排版的标签中定义的CSS属性值进行修改包括:A7. The method according to claim A6, wherein said modifying the CSS attribute value defined in the label that affects typesetting comprises:
当所述当前正在解析的页面元素为表格元素时,对表格元素及表格元素的内联元素的CSS值进行修改,以便所述表格元素能够自动换行;When the page element currently being parsed is a table element, the CSS value of the table element and the inline element of the table element is modified so that the table element can wrap automatically;
或者,or,
当所述当前正在解析的页面元素为表单输入控件、下拉菜单/列表、文本域或内联框架元素,并且存在表示其宽度的绝对数值时,将所述绝对数值修改为相对数值;When the page element currently being parsed is a form input control, drop-down menu/list, text field or inline frame element, and there is an absolute value representing its width, modify the absolute value to a relative value;
或者,or,
当所述当前正在解析的页面元素为图像元素时,比较该图像元素的width值与移动终端的屏幕宽度值,如果所述width值大于移动终端的屏幕宽度值,则按照所述width值与移动终端的屏幕宽度之间的比例,等比例缩小所述width值;如果所述width值小于移动终端的屏幕宽度值,但大于移动终端的屏幕宽度值的二分之一,则将该图像元素的位置属性值修改为居中显示;When the page element currently being parsed is an image element, compare the width value of the image element with the screen width value of the mobile terminal, if the width value is greater than the screen width value of the mobile terminal, then move according to the width value and the mobile terminal The ratio between the screen widths of the terminal, the width value is proportionally reduced; if the width value is less than the screen width value of the mobile terminal, but greater than half of the screen width value of the mobile terminal, then the image element The position attribute value is modified to be displayed in the center;
或者,or,
如果所述当前正在解析的页面元素为超链接元素,并且所述超链接元素中包含img标签以及文本,则为所述img标签加入边界属性值;If the page element currently being parsed is a hyperlink element, and the hyperlink element contains an img tag and text, then add a boundary attribute value to the img tag;
或者,or,
如果所述当前正在解析的页面元素为分区元素,则为所述分区元素加入边界属性值。If the page element currently being parsed is a partition element, add a boundary attribute value to the partition element.
A8、根据权利要求A1所述的方法,所述将渲染树节点中包含的影响排版的CSS属性去掉包括:A8. The method according to claim A1, said removing CSS attributes that affect layout included in the rendering tree node includes:
将所述当前正在解析的页面元素包含的宽度高度的绝对属性、定位属性、背景图属性和/或与文本显示相关的属性去掉;Remove the absolute attributes of width and height, positioning attributes, background image attributes and/or attributes related to text display contained in the page element currently being parsed;
和/或,and / or,
将元素盒模型中的边框与填充属性去掉。Remove the border and padding properties in the element box model.
A9、根据权利要求A8所述的方法,其特征在于,如果将所述当前正在解析的页面元素的背景图去掉,则还包括:A9, the method according to claim A8, is characterized in that, if the background image of the page element currently being parsed is removed, it also includes:
修改所述页面元素中包含的文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。The color attribute value of the text included in the page element is modified to ensure the recognition of the text after the background image is removed.
A10、根据权利要求A9所述的方法,其特征在于,所述修改所述页面元素中包含的文本的颜色属性值,包括:A10. The method according to claim A9, wherein said modifying the color attribute value of the text contained in said page element comprises:
如果页面元素内文本颜色是白色,则设置所述文本颜色为网页文本默认颜色;If the text color in the page element is white, then set the text color as the default color of the web page text;
或者,or,
如果网页元素内文本颜色不是白色,并且所述元素背景色不透明,则设置文本颜色为所述元素背景色具有预置色差值的颜色;If the text color in the webpage element is not white, and the background color of the element is opaque, then set the text color to the color of the background color of the element with a preset color difference value;
或者,or,
如果网页元素内文本颜色不是白色,并且所述元素背景色透明,则设置文本颜色为与此网页的主体元素的背景色具有预置色差值的颜色。If the text color in the web page element is not white, and the background color of the element is transparent, the text color is set to a color with a preset color difference value from the background color of the main element of the web page.
B11、一种在移动终端中显示网页的装置,其特征在于,包括:B11, a device for displaying web pages in a mobile terminal, characterized in that it includes:
资源获取单元,用于接收到通过移动终端访问网页的请求,根据所述请求向网页服务器获取所述网页对应的资源;A resource obtaining unit, configured to receive a request for accessing a webpage through a mobile terminal, and obtain resources corresponding to the webpage from a webpage server according to the request;
标签处理单元,用于对所述网页资源中包含的页面元素进行解析,解析过程中,判断当前页面元素对应的标签是否影响排版,如果存在影响排版的标签,则对所述影响排版的标签进行处理;The label processing unit is used to analyze the page elements contained in the webpage resources. During the analysis process, it is judged whether the label corresponding to the current page element affects the typesetting. If there is a label that affects the typesetting, the label that affects the typesetting is processed. deal with;
渲染树构造单元,用于根据处理后的标签构造渲染树的节点,判断是否存在影响排版的层叠样式表CSS属性,如果存在影响排版的层叠样式表CSS属性,则去除影响排版的CSS属性,之后按照构造的渲染树对网页内容进行绘制并显示。The rendering tree construction unit is used to construct the nodes of the rendering tree according to the processed tags, and judge whether there are cascading style sheet CSS attributes that affect the layout. If there are cascading style sheet CSS attributes that affect the layout, remove the CSS attributes that affect the layout, and then Draw and display the web page content according to the constructed rendering tree.
B12、根据权利要求B11所述的装置,其特征在于,所述标签处理单元包括:B12. The device according to claim B11, wherein the label processing unit comprises:
标签去掉子单元,用于将影响排版的标签去掉,以便在根据处理后的标签构造渲染树的节点时,将该标签对应的页面元素作为普通文本处理。The tag removal subunit is used to remove tags that affect typesetting, so that when the nodes of the rendering tree are constructed based on the processed tags, the page elements corresponding to the tags are treated as ordinary text.
B13、根据权利要求B12所述的装置,其特征在于,所述标签去掉子单元具体用于:如果所述当前正在解析的页面元素为普通卷动元素、下标元素或上标元素,则将这种页面元素的标签去掉。B13. The device according to claim B12, wherein the label removal subunit is specifically used for: if the page element currently being parsed is an ordinary scrolling element, a subscript element or a superscript element, then the The label of this page element is removed.
B14、根据权利要求B11所述的装置,其特征在于,所述标签处理单元包括:B14. The device according to claim B11, wherein the label processing unit comprises:
元素去掉子单元,用于将当前页面元素去掉,以便在根据处理后的标签构造渲染树的节点时,不再生成该页面元素对应的节点。The element removal subunit is used to remove the current page element, so that when the node of the rendering tree is constructed according to the processed label, the node corresponding to the page element is no longer generated.
B15、根据权利要求B14所述的装置,其特征在于,所述元素去掉子单元具体用于:如果所述当前正在解析的页面元素为普通卷动元素、包含对象的元素、嵌入页面的元素、下标元素或上标元素,则将这种页面元素去掉。B15. The device according to claim B14, wherein the element removal subunit is specifically used for: if the page element currently being parsed is a common scrolling element, an element containing an object, an element embedded in a page, Subscript elements or superscript elements, remove such page elements.
B16、根据权利要求B11所述的装置,其特征在于,所述标签处理单元包括:B16. The device according to claim B11, wherein the label processing unit comprises:
属性值修改子单元,用于将影响排版的标签中定义的CSS属性值进行修改;The attribute value modification subunit is used to modify the CSS attribute value defined in the tag that affects layout;
所述渲染树构造单元还用于:The rendering tree construction unit is also used for:
利用修改后的CSS属性值为渲染树中该页面元素对应的节点的CSS属性进行赋值。The modified CSS property value is used to assign a value to the CSS property of the node corresponding to the page element in the rendering tree.
B17、根据权利要求B16所述的装置,其特征在于,所述属性值修改子单元包括:B17. The device according to claim B16, wherein the attribute value modification subunit comprises:
第一修改子单元,用于当所述当前正在解析的页面元素为表格元素时,对表格元素及表格元素的内联元素的CSS值进行修改,以便所述表格元素能够自动换行;The first modification subunit is used to modify the CSS value of the table element and the inline element of the table element when the page element currently being parsed is a table element, so that the table element can wrap automatically;
或者,or,
第二修改子单元,用于当所述当前正在解析的页面元素为表单输入控件、下拉菜单/列表、文本域或内联框架元素,并且存在表示其宽度的绝对数值时,将所述绝对数值修改为相对数值;The second modification subunit is used to convert the absolute value to Modified to a relative value;
或者,or,
第三修改子单元,用于当所述当前正在解析的页面元素为图像元素时,比较该图像元素的width值与移动终端的屏幕宽度值,如果所述width值大于移动终端的屏幕宽度值,则按照所述width值与移动终端的屏幕宽度之间的比例,等比例缩小所述width值;如果所述width值小于移动终端的屏幕宽度值,但大于移动终端的屏幕宽度值的二分之一,则将该图像元素的位置属性值修改为居中显示;The third modification subunit is used to compare the width value of the image element with the screen width value of the mobile terminal when the page element currently being parsed is an image element, if the width value is greater than the screen width value of the mobile terminal, Then according to the ratio between the width value and the screen width of the mobile terminal, the width value is proportionally reduced; if the width value is less than the screen width value of the mobile terminal, but greater than half of the screen width value of the mobile terminal One, modify the value of the position attribute of the image element to display in the center;
或者,or,
第四修改子单元,用于如果所述当前正在解析的页面元素为超链接元素,并且所述超链接元素中包含img标签以及文本,则为所述img标签加入边界属性值;The fourth modification subunit is used to add boundary attribute values to the img tag if the page element currently being parsed is a hyperlink element, and the hyperlink element contains img tags and text;
或者,or,
第五修改子单元,用于如果所述当前正在解析的页面元素为分区元素,则为所述分区元素加入边界属性值。The fifth modification subunit is configured to add a boundary attribute value to the partition element if the page element currently being parsed is a partition element.
B18、根据权利要求B11所述的装置,所述渲染树构造单元包括:B18. The device according to claim B11, the rendering tree construction unit comprises:
第一属性去掉子单元,用于将所述当前正在解析的页面元素包含的宽度高度的绝对属性、定位属性、背景图属性和/或与文本显示相关的属性去掉;The first attribute removes subunits, which are used to remove the absolute attributes of width and height contained in the page element currently being parsed, positioning attributes, background image attributes and/or attributes related to text display;
和/或,and / or,
第二属性去掉子单元,用于将元素盒模型中的边框与填充属性去掉。The second attribute removes the subunit, which is used to remove the border and padding attributes in the element box model.
B19、根据权利要求B18所述的装置,其特征在于,还包括:B19. The device according to claim B18, further comprising:
文本颜色修改单元,用于如果将所述当前正在解析的页面元素的背景图去掉,修改所述页面元素中包含的文本的颜色属性值,以保证在去掉背景图之后所述文本的辨识度。The text color modifying unit is configured to modify the color attribute value of the text contained in the page element if the background image of the page element currently being parsed is removed, so as to ensure the recognition of the text after the background image is removed.
B20、根据权利要求B19所述的装置,其特征在于,所述文本颜色修改单元包括:B20. The device according to claim B19, wherein the text color modification unit comprises:
第一颜色修改子单元,用于如果页面元素内文本颜色是白色,则设置所述文本颜色为网页文本默认颜色;The first color modification subunit is used to set the text color as the default color of the webpage text if the text color in the page element is white;
或者,or,
第二颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色不透明,则设置文本颜色为所述元素背景色具有预置色差值的颜色;The second color modification subunit is used to set the text color as the color of the background color of the element with a preset color difference value if the text color in the web page element is not white and the background color of the element is opaque;
或者,or,
第三颜色修改子单元,用于如果网页元素内文本颜色不是白色,并且所述元素背景色透明,则设置文本颜色为与此网页的主体元素的背景色具有预置色差值的颜色。The third color modification subunit is used to set the text color to a color with a preset color difference value from the background color of the main element of the webpage if the text color in the webpage element is not white and the background color of the element is transparent.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410525792.4A CN104217037B (en) | 2012-04-23 | 2012-04-23 | A kind of method and device for showing webpage in the terminal |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210120620.XA CN102663126B (en) | 2012-04-23 | 2012-04-23 | Method and device for displaying webpage in mobile terminal |
CN201410525792.4A CN104217037B (en) | 2012-04-23 | 2012-04-23 | A kind of method and device for showing webpage in the terminal |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210120620.XA Division CN102663126B (en) | 2012-04-23 | 2012-04-23 | Method and device for displaying webpage in mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104217037A true CN104217037A (en) | 2014-12-17 |
CN104217037B CN104217037B (en) | 2018-03-23 |
Family
ID=52098526
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410525792.4A Expired - Fee Related CN104217037B (en) | 2012-04-23 | 2012-04-23 | A kind of method and device for showing webpage in the terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104217037B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055575A (en) * | 2016-05-19 | 2016-10-26 | 天脉聚源(北京)传媒科技有限公司 | Method and device for optimized loading of website page |
CN106294504A (en) * | 2015-06-09 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The display packing of a kind of Web page icon and device |
CN106503212A (en) * | 2016-10-27 | 2017-03-15 | 中企动力科技股份有限公司 | A kind of method to set up of web page element pattern and device |
CN106686037A (en) * | 2015-11-09 | 2017-05-17 | 广州市动景计算机科技有限公司 | Page detecting method, device, equipment and system |
CN106874271A (en) * | 2015-12-10 | 2017-06-20 | 上海新工式网络科技有限公司 | A kind of method and system that PC webpages are converted to mobile terminal webpage |
CN107247691A (en) * | 2017-05-24 | 2017-10-13 | 腾讯科技(深圳)有限公司 | A kind of display methods of text message, device, mobile terminal and storage medium |
CN107632970A (en) * | 2017-09-29 | 2018-01-26 | 彩讯科技股份有限公司 | A kind of Mail Contents code-transferring method and device |
CN108280101A (en) * | 2017-01-25 | 2018-07-13 | 广州市动景计算机科技有限公司 | user terminal and web page picture resource loading device and method |
CN109977331A (en) * | 2019-03-04 | 2019-07-05 | 东软集团股份有限公司 | Control the method and device that page resource executes |
CN110309044A (en) * | 2018-03-20 | 2019-10-08 | 福建天泉教育科技有限公司 | Pattern changed test method and terminal in a kind of Web system |
CN110413566A (en) * | 2019-07-04 | 2019-11-05 | 广州视源电子科技股份有限公司 | Courseware storage and processing method and device, intelligent interaction panel and storage medium |
CN112507257A (en) * | 2020-12-07 | 2021-03-16 | 北京达佳互联信息技术有限公司 | Webpage display method, device, equipment and storage medium |
CN112784202A (en) * | 2021-02-03 | 2021-05-11 | 中国电子科技集团公司第二十八研究所 | Method for improving definition of webpage screenshot based on WEB technology |
CN114817804A (en) * | 2022-03-31 | 2022-07-29 | 北京达佳互联信息技术有限公司 | Webpage generation method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6556217B1 (en) * | 2000-06-01 | 2003-04-29 | Nokia Corporation | System and method for content adaptation and pagination based on terminal capabilities |
CN102065106A (en) * | 2009-11-16 | 2011-05-18 | 中国电信股份有限公司 | Web flow collator, and method and system for accessing Web page by using terminal |
CN102184249A (en) * | 2011-05-23 | 2011-09-14 | 广州市动景计算机科技有限公司 | Webpage layout method and device based on mobile terminal |
CN102184231A (en) * | 2011-05-12 | 2011-09-14 | 广州市动景计算机科技有限公司 | Method and device for acquiring page resources |
CN102325188A (en) * | 2011-09-16 | 2012-01-18 | 北京新媒传信科技有限公司 | Method for realizing webpage browsing on a mobile terminal and system thereof |
-
2012
- 2012-04-23 CN CN201410525792.4A patent/CN104217037B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6556217B1 (en) * | 2000-06-01 | 2003-04-29 | Nokia Corporation | System and method for content adaptation and pagination based on terminal capabilities |
CN102065106A (en) * | 2009-11-16 | 2011-05-18 | 中国电信股份有限公司 | Web flow collator, and method and system for accessing Web page by using terminal |
CN102184231A (en) * | 2011-05-12 | 2011-09-14 | 广州市动景计算机科技有限公司 | Method and device for acquiring page resources |
CN102184249A (en) * | 2011-05-23 | 2011-09-14 | 广州市动景计算机科技有限公司 | Webpage layout method and device based on mobile terminal |
CN102325188A (en) * | 2011-09-16 | 2012-01-18 | 北京新媒传信科技有限公司 | Method for realizing webpage browsing on a mobile terminal and system thereof |
Non-Patent Citations (1)
Title |
---|
杨灵芝: "《基于Cocoon框架的网页自适应转换模型研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106294504A (en) * | 2015-06-09 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The display packing of a kind of Web page icon and device |
CN106686037A (en) * | 2015-11-09 | 2017-05-17 | 广州市动景计算机科技有限公司 | Page detecting method, device, equipment and system |
CN106686037B (en) * | 2015-11-09 | 2020-10-16 | 阿里巴巴(中国)有限公司 | Page detection method, device, equipment and system |
CN106874271A (en) * | 2015-12-10 | 2017-06-20 | 上海新工式网络科技有限公司 | A kind of method and system that PC webpages are converted to mobile terminal webpage |
CN106055575A (en) * | 2016-05-19 | 2016-10-26 | 天脉聚源(北京)传媒科技有限公司 | Method and device for optimized loading of website page |
CN106503212A (en) * | 2016-10-27 | 2017-03-15 | 中企动力科技股份有限公司 | A kind of method to set up of web page element pattern and device |
CN108280101A (en) * | 2017-01-25 | 2018-07-13 | 广州市动景计算机科技有限公司 | user terminal and web page picture resource loading device and method |
CN107247691B (en) * | 2017-05-24 | 2021-10-08 | 腾讯科技(深圳)有限公司 | Text information display method and device, mobile terminal and storage medium |
CN107247691A (en) * | 2017-05-24 | 2017-10-13 | 腾讯科技(深圳)有限公司 | A kind of display methods of text message, device, mobile terminal and storage medium |
CN107632970A (en) * | 2017-09-29 | 2018-01-26 | 彩讯科技股份有限公司 | A kind of Mail Contents code-transferring method and device |
CN110309044A (en) * | 2018-03-20 | 2019-10-08 | 福建天泉教育科技有限公司 | Pattern changed test method and terminal in a kind of Web system |
CN110309044B (en) * | 2018-03-20 | 2022-10-21 | 福建天泉教育科技有限公司 | Method and terminal for testing style change in Web system |
CN109977331A (en) * | 2019-03-04 | 2019-07-05 | 东软集团股份有限公司 | Control the method and device that page resource executes |
CN110413566A (en) * | 2019-07-04 | 2019-11-05 | 广州视源电子科技股份有限公司 | Courseware storage and processing method and device, intelligent interaction panel and storage medium |
CN112507257A (en) * | 2020-12-07 | 2021-03-16 | 北京达佳互联信息技术有限公司 | Webpage display method, device, equipment and storage medium |
CN112507257B (en) * | 2020-12-07 | 2024-03-26 | 北京达佳互联信息技术有限公司 | Webpage display method, device, equipment and storage medium |
CN112784202A (en) * | 2021-02-03 | 2021-05-11 | 中国电子科技集团公司第二十八研究所 | Method for improving definition of webpage screenshot based on WEB technology |
CN112784202B (en) * | 2021-02-03 | 2022-10-04 | 中国电子科技集团公司第二十八研究所 | Method for improving definition of webpage screenshot based on WEB technology |
CN114817804A (en) * | 2022-03-31 | 2022-07-29 | 北京达佳互联信息技术有限公司 | Webpage generation method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN104217037B (en) | 2018-03-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102663126B (en) | Method and device for displaying webpage in mobile terminal | |
CN104217037B (en) | A kind of method and device for showing webpage in the terminal | |
CN102819560B (en) | The display methods and device of picture in a kind of webpage | |
US10289649B2 (en) | Webpage advertisement interception method, device and browser | |
US10325012B2 (en) | Filtered stylesheets | |
CN102779167B (en) | The method and system of display web page in the terminal | |
CN108415702B (en) | Dynamic rendering method and device for application interface of mobile terminal | |
CN103412928B (en) | Method and device for realizing browser page intelligent response-type layout on mobile terminal | |
US20140006934A1 (en) | Method for rearranging web page | |
US20150286739A1 (en) | Html5-protocol-based webpage presentation method and device | |
WO2015196822A1 (en) | Method and device for adapting webpage to screen layout | |
CN104820589B (en) | A kind of method and its device of dynamic adaptation webpage | |
CN109683978B (en) | Stream type layout interface rendering method and device and electronic equipment | |
US9465780B2 (en) | User terminal device and scroll method supporting high-speed web scroll of web document | |
KR102574306B1 (en) | dynamic typesetting | |
CN103176954A (en) | Mathematical formula display method and mathematical formula display system based on hypertext markup language (HTML) 5 canvas | |
CN105979393A (en) | Web page display method and device, and intelligent television system | |
CN110020304A (en) | A kind of method and apparatus of loading page | |
CN103581232A (en) | Web page transmission method, web page displaying device and system including device | |
Krause | Introducing Web Development | |
CN106575303B (en) | Method and device for displaying webpage | |
CN102681848B (en) | Develop in microtec mode and the method for accessed web page, device, terminal and system | |
JP2006331142A (en) | Information provision system, and information provision method or the like | |
CN110209965A (en) | Method and apparatus for showing information | |
CN105468746B (en) | Web-page Multi-media content processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180323 Termination date: 20210423 |