WO2013097638A1 - 网页重排方法、网页重排装置以及移动终端 - Google Patents

网页重排方法、网页重排装置以及移动终端 Download PDF

Info

Publication number
WO2013097638A1
WO2013097638A1 PCT/CN2012/086935 CN2012086935W WO2013097638A1 WO 2013097638 A1 WO2013097638 A1 WO 2013097638A1 CN 2012086935 W CN2012086935 W CN 2012086935W WO 2013097638 A1 WO2013097638 A1 WO 2013097638A1
Authority
WO
WIPO (PCT)
Prior art keywords
content
picture
picture content
webpage
text
Prior art date
Application number
PCT/CN2012/086935
Other languages
English (en)
French (fr)
Inventor
梁捷
Original Assignee
优视科技有限公司
广州市动景计算机科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 优视科技有限公司, 广州市动景计算机科技有限公司 filed Critical 优视科技有限公司
Priority to US14/130,463 priority Critical patent/US9886519B2/en
Publication of WO2013097638A1 publication Critical patent/WO2013097638A1/zh

Links

Classifications

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

Definitions

  • Web page rearrangement method Web page rearrangement method, web page rearrangement device, and mobile terminal
  • the present invention relates to the field of mobile communications, and more particularly to a webpage rearrangement method for rearranging webpages in which text content is inserted in text content, a webpage rearranging apparatus, and a mobile terminal having the webpage rearranging apparatus
  • Another object of the present invention is to provide a web page rearrangement apparatus for performing the above-described web page rearrangement method and a mobile terminal having the web page rearrangement apparatus.
  • a webpage rearrangement method for rearranging a webpage in which text content is inserted in a text content including: calculating a content of the image when re-formatting the image content in the webpage a layout area width; when the picture content does not include an attribute for indicating that the picture content is to be used, determining whether the picture content is in a large piece of text; and when the picture content is in a large piece of text, according to the mobile terminal
  • the screen width size and the layout area width of the picture content are adjusted for the layout area size of the picture content.
  • the step of determining whether the picture content is in a large piece of text may include: determining whether a parent node of the picture content is a node for representing text content, or determining a brother of the picture content Whether there are at least two other content nodes in the node, wherein when the parent node of the picture content is a node for representing text content, or the sibling node of the picture content has at least two other contents, determining that the picture content is located in a large segment In the text.
  • the method may further include: determining whether the layout area width of the picture content is within a preset range, where When the layout area width of the picture content is within the preset range, the layout area size of the picture content is adjusted according to the screen width size of the mobile terminal.
  • the method may further include: adding, in the picture node of the picture content, the instruction to force the picture at the time of typesetting A mark that is left aligned with the content.
  • the step of adjusting a layout area size of the picture content may include: modifying a width of the layout area of the picture content to a screen width of the mobile terminal minus a predetermined number of pixels; The height of the typesetting area is scaled according to the adjustment of the layout area width.
  • a webpage rearrangement apparatus for rearranging a webpage in which text content is inserted in a text content, including: a calculating unit, configured to re-format a photo content in a webpage Calculating a layout area width of the picture content; a first determining unit, configured to determine, when the picture content does not include an attribute for indicating that the picture content is to be used, whether the picture content is in a large piece of text; and size adjustment And a unit, configured to adjust a layout area size of the picture content according to a screen width size of the mobile terminal when the picture content is located in a large segment of text.
  • the determining unit may be configured to determine whether a parent node of the picture content is a node for representing text content, or determine whether a sibling node of the picture content has at least two other a content node, wherein when the parent node of the picture content is a node for representing text content, or the sibling node of the picture content has at least two other content nodes, the determining unit determines that the picture content is located in a large segment of text .
  • the webpage rearranging apparatus may further include a second determining unit, configured to determine whether the layout area width of the image content is in the size of the layout area size of the image content. In the preset range, when the layout area width of the picture content is within the preset range, the size adjustment unit adjusts the layout area size of the picture content according to the screen width size of the mobile terminal.
  • the webpage rearrangement apparatus may further include a mark adding unit, configured to add, in the picture node of the picture content, the picture node of the picture content after the size adjustment unit completes the typesetting area size adjustment A flag indicating that the image content is left aligned when it is typeset.
  • the resizing unit may include: a width modifying module, configured to modify a width of the typesetting area of the picture content to a screen width of the mobile terminal minus a predetermined number of pixels; and a height
  • the modification module is configured to scale the height of the typesetting area according to the adjustment of the width of the typesetting area.
  • a mobile terminal comprising the web page rearrangement device as described above.
  • the image located in the large section of text can be automatically scaled according to the screen width when the page is zoomed, so that the screen can be displayed within the screen width of the mobile terminal.
  • the picture thereby preventing the user from dragging left and right while reading the graphic content, thereby improving the reading experience.
  • the picture can be displayed in the same column as the text within the screen width, thereby further improving the reading experience.
  • FIG. 1 is a flow chart showing an example of a web page rearranging method for rearranging a web page in which text content is inserted in text content, in accordance with an embodiment of the present invention
  • FIG. 2 is a view showing a display result of currently viewed text content in which picture content is inserted
  • FIG. 3 is a view showing the page rearranging method according to the present invention, which is shown in FIG. 2 after the display area of the picture content is enlarged
  • FIG. 4 is a view showing a display result after web page rearrangement of the display result shown in FIG. 2 by the web page rearranging method according to the present invention after the display area of the picture content is enlarged;
  • FIG. 5 is a diagram showing a display result after web page rearrangement of the display result shown in FIG. 2 by the web page rearranging method according to the present invention after the screen width of the mobile terminal is enlarged;
  • FIG. 6 is a diagram showing a display result of currently viewed webpage content
  • Figure 7 is a diagram showing the result of performing web page rearrangement according to the method of the present invention after magnifying a picture in Figure 6;
  • Figure 8 is a diagram showing the result of performing web page rearrangement according to the method of the present invention after the page of Figure 7 is reduced;
  • FIG. 9 is a block diagram showing an example of a web page rearranging apparatus for rearranging a web page in which text content is inserted in text content, according to an embodiment of the present invention.
  • Figure 10 is a block schematic diagram of a mobile terminal having a web page rearrangement device in accordance with the present invention.
  • FIG. 1 is a flow chart showing an example of a web page rearranging method for rearranging a web page in which text content is inserted in text content, in accordance with an embodiment of the present invention.
  • step S110 it is determined whether it is necessary to rearrange the picture content in the web page. For example, it is judged whether or not the display size of the picture content to be displayed on the mobile terminal has changed, or whether the screen width of the mobile terminal has changed.
  • the display size of the picture content to be displayed on the mobile terminal changes, for example, the display area of the picture content is enlarged or reduced, it is determined that the picture content in the web page needs to be rearranged.
  • the screen width of the mobile terminal changes, for example, if the mobile terminal changes from the portrait display to the landscape display, or changes from the landscape display to the portrait display, it is determined that the image content in the webpage needs to be rearranged. . If it is determined that no rearrangement is required, the flow ends.
  • the layout area width of the picture content is calculated. For example, when traversing and typographically according to the structure of the DOM tree, there is a process of calculating the layout area occupied by the node in the layout process, and the area is the size of the image described in the webpage, and the image is also rendered on a normal desktop browser.
  • the size of the picture node when the node is. That is to say, the layout area width of the picture content can be calculated by analyzing the description language of the web page.
  • step S130 it is determined whether the picture content contains an attribute indicating that the picture content is to be used and whether the picture content is in a large piece of text.
  • the attribute for indicating that the picture content is to be used includes, for example, a usemap attribute. If the image content contains this type of property, modifying the image size may break the event trigger logic, such as the logic of the mouse click event.
  • determining whether the content of the picture is included in a large piece of text can be determined in the following manner. For example, determining whether the parent node of the picture content is a node for representing text content, for example, determining whether a parent node includes a label for representing a paragraph of text content.
  • ⁇ p> or tag ⁇ font> or determine whether there are at least two other content nodes in the sibling node of the picture content, such as a text node, a ⁇ br> node or a picture node.
  • the parent node of the picture content is a node for representing text content, for example, a tag ⁇ p> or a tag ⁇ font> containing a paragraph for representing the text content, or at least two sibling nodes of the picture content exist
  • other text nodes, ⁇ br> nodes, or picture nodes it is determined that the picture content is in a large segment of text. Otherwise, the picture content is considered not to be in a large text.
  • step S130 When the picture content includes an attribute for indicating that the picture content is to be used or the picture content is not in the large-length text, that is, when the determination result of step S130 is NO, the flow ends.
  • the picture content does not contain an attribute for indicating that the picture content is to be used and is located in a large piece of text, that is, if the decision result in step S130 is YES, the flow advances to step S140.
  • step S140 it is determined whether the layout area width of the picture content is within a preset range.
  • the preset range may be set according to the screen width of the mobile terminal. Typically, for portrait displays, the preset range is set to be less than 950 pixels and greater than 120 pixels. With this preset range, you can filter smaller images and larger URLs and ads that would not exceed the screen width.
  • the preset range also changes. For example, when the screen width changes from portrait to wide screen, the lower limit of the above preset range becomes larger.
  • step S150 When the layout area width of the picture content is within the preset range, the process proceeds to step S150. Otherwise, the process ends.
  • the layout area size of the picture content is adjusted according to the screen width size of the mobile terminal.
  • the method may include: modifying a width of the layout area of the picture content to a screen width of the mobile terminal minus a predetermined number of pixels; and according to the layout area width Adjust to scale the height of the layout area.
  • a predetermined number of pixels can be freely set as needed, and is usually set to 20 pixels.
  • the above example is just an illustration.
  • a person skilled in the art may also adopt other suitable manners to perform screen adaptive adjustment on the layout area size of the picture content based on the layout area width of the picture content and the screen width size of the mobile terminal.
  • the height adjustment here is adjusted in proportion to the adjustment of the width dimension.
  • the adjustment of the image is only the width of the image, which is to be scaled and then drawn in the image rendering stage, instead of scaling the original data of the image to replace the original image data, so that the image will not be reduced and then enlarged to cause distortion.
  • the method may further include step S160.
  • step S160 a flag for instructing the left side of the picture content to be aligned at the time of typesetting is added to the picture node of the picture content.
  • This tag is an extension of the browser kernel DOM tree node attribute. When this tag is encountered during the layout process, the attributes such as text-align, indent, margin, etc. are ignored, causing the elements to not be left-aligned, thus allowing the image and text to reside. The purpose of the same column.
  • it may further comprise determining whether the picture content display is centered. When it is determined that the picture content display is centered, the process proceeds to step S160. Otherwise, the process returns to step S150 to re-adjust the layout area size of the picture content until the picture content is displayed centered.
  • the above-described web page image rearranging determination step S110 may be omitted, that is, the web page rearrangement process of the present invention is performed in the case where it has been considered that the web page image needs to be rearranged.
  • step S140 may also be omitted. That is to say, the size of any webpage image that meets the above conditions is resized. Further, in another example, in the case where the web page picture is already left aligned, step S160 may also be omitted.
  • Fig. 2 is a diagram showing a display result of text content in which picture content is currently viewed, according to an example.
  • Fig. 3 is a view showing a display result after web page rearrangement of the display result shown in Fig. 2 by the web page rearranging method according to the present invention after the display area of the picture content is enlarged.
  • Fig. 4 is a view showing a display result after web page rearrangement of the display result shown in Fig. 2 by the web page rearranging method according to the present invention after the display area of the picture content is enlarged.
  • Fig. 5 is a view showing a display result after web page rearrangement of the display result shown in Fig. 2 by the web page rearranging method according to the present invention after the screen width of the mobile terminal is enlarged.
  • FIG 2 an ordinary news is shown.
  • the theme part of the news has two pictures. Both pictures are larger pictures.
  • the page is enlarged according to the default zoom ratio. Cannot be displayed completely in one screen range.
  • FIG. 3 is an enlarged view of the display area of the first picture in FIG. 2.
  • the browser kernel triggers page rearrangement, and the picture size automatic scaling process is triggered during the rearrangement process (ie, the web page image according to the present invention is heavy. Rows, the associated image will automatically shrink according to the width of the screen, and will be left-aligned from the original centered, and the context word will be in the same column.
  • FIG. 5 is a rearrangement result triggered when the display screen of the mobile terminal changes from a portrait screen to a landscape screen. Due to the screen width of the screen When the change is made, the page will trigger a rearrangement, and all the images that need to be automatically scaled will also be resized. As shown in FIG. 5, the size of the displayed picture is larger than that in the vertical screen display, but it is still within the screen width.
  • FIG. 6 is a diagram showing a display result of web content currently browsed according to another example.
  • Fig. 7 is a view showing the result of performing web page rearrangement according to the method of the present invention after magnifying a picture in Fig. 6.
  • Fig. 8 is a view showing the result of performing web page rearrangement according to the method of the present invention after the page of Fig. 7 is reduced.
  • Figure 6 shows a thumbnail of an article.
  • Fig. 7 is a view showing a page rearrangement after a click-up of a picture in Fig. 6 is performed.
  • Fig. 8 is an example of the reduction of the page of Fig. 7 so that more text is received on one screen, in which all the pictures conforming to the automatic zoom condition are rescaled to fit the screen width display.
  • the webpage rearrangement method according to the present invention is described above with reference to FIG. 1 to FIG. 8.
  • the foregoing webpage rearrangement method of the present invention may be implemented by software, implemented by hardware, or implemented by a combination of software and hardware.
  • Figure 9 is a block diagram showing an example of a web page rearranging apparatus 900 for rearranging web pages in which text content is inserted in text content, in accordance with an embodiment of the present invention.
  • the webpage rearranging apparatus 900 includes a webpage rearrangement determining unit 910, a calculating unit 920, a first determining unit 930, a second determining unit 940, a resizing unit 950, and a mark adding unit 960.
  • the webpage rearrangement determining unit 910 is configured to determine whether it is necessary to rearrange the image content in the webpage. For example, it is judged whether or not the display size of the picture content to be displayed on the mobile terminal has changed, or whether the screen width of the mobile terminal has changed. When the display size of the picture content to be displayed on the mobile terminal changes, for example, the display area of the picture content is enlarged or reduced, it is determined that the picture content in the web page needs to be rearranged. Or, when the screen width of the mobile terminal changes, for example, if the mobile terminal changes from the portrait display to the landscape display, or changes from the landscape display to the portrait display, it is determined that the image content in the webpage needs to be rearranged. .
  • the web page rearrangement determining unit 910 may not be included.
  • the page content in the web page is rearranged, or in the case where the picture content of the web page has been predetermined or considered to be rearranged.
  • the calculating unit 920 is configured to calculate a layout area width of the picture content when re-laying the picture content in the webpage. If you calculate the layout area width of the picture content, see the description above.
  • the first determining unit 930 is configured to determine whether the picture content is in a large piece of text when the picture content does not include an attribute for indicating that the picture content is to be used. Judging whether the content of the picture is included in a large piece of text can be determined in the following manner. For example, determining whether the parent node of the picture content is a node for representing text content, for example, determining whether the parent node contains a tag ⁇ p> for representing a paragraph of text content or Tag ⁇ font>, or determine whether the sibling node of the picture content has at least two other content nodes, such as a text node, a ⁇ br> node, or a picture node.
  • the parent node of the picture content is a node for representing the text content
  • the parent node includes a tag ⁇ p> or a tag ⁇ font> for indicating a paragraph of the text content, or the sibling node of the picture content exists
  • ⁇ br> nodes or picture nodes
  • the second determining unit 940 determines whether the layout area width of the picture content is within a preset range.
  • the preset range may be set according to a screen width of the mobile terminal. When the screen width of the mobile terminal changes, the preset range also changes.
  • the size adjustment unit 950 adjusts the layout area size of the picture content according to the screen width size of the mobile terminal.
  • the resizing unit includes: a width modifying module (not shown) for modifying a width of a typesetting area of the picture content to a screen width of the mobile terminal minus a predetermined number of pixels; and a height modifying module (not shown), for scaling the height of the typesetting area according to the adjustment of the layout area width.
  • the mark adding unit 960 adds a mark in the picture node of the picture content to indicate that the picture content is left-aligned at the time of typesetting.
  • the web page rearranging apparatus 900 shown in FIG. 9 is only one example of the web page rearranging apparatus of the present invention, and those skilled in the art can rearrange the web pages shown in FIG. 9 in a manner similar to the modification in the above method.
  • the device 900 performs various modifications.
  • the image located in the large segment of text is automatically scaled according to the screen width, so that the image can be displayed within the screen width of the mobile terminal, thereby avoiding The user drags left and right while reading the graphic content to improve the reading experience.
  • the picture can be displayed in the same column as the text within the screen width, thereby further improving the reading experience.
  • FIG. 10 is a block schematic diagram of a mobile terminal 10 having a web page rearrangement device 900 in accordance with the present invention.
  • the mobile terminal 10 includes the web page rearranging device 900 as described above. It will be apparent that the web page rearrangement apparatus of Fig. 10 may also include various variations of the web page rearranging apparatus 900 shown in Fig. 9.
  • the mobile terminal of the present invention can be a variety of handheld terminal devices, such as mobile phones, personal digital assistants (PDAs), etc., and thus the scope of protection of the present invention should not be limited to a particular type of mobile terminal.
  • PDAs personal digital assistants
  • the method according to the invention can also be implemented as a computer program executed by a CPU.
  • the computer program is executed by the CPU, the above-described functions defined in the method of the present invention are performed.
  • non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash flash.
  • Volatile memory can include random access memory (RAM), which can act as external cache memory.
  • RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), ⁇ Zengqiang SDRAM (ESDRAM). ), synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM).
  • DRAM synchronous RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM ⁇ Zengqiang SDRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct Rambus RAM
  • DSP digital signal processor
  • ASIC dedicated Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • the processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
  • a software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from or write information to the storage medium.
  • the storage medium can be integrated with a processor.
  • the processor and the storage medium can reside in an ASIC.
  • the ASIC can reside in the user terminal.
  • the processor and the storage medium may reside as a discrete component in the user terminal.
  • the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or code on a computer readable medium or transmitted through a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a general purpose or special purpose computer.
  • the computer readable medium may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage device, disk storage device or other magnetic storage device, or may be used in the form of carrying or storing instructions Or the required program code of the data structure and any other medium that can be accessed by a general purpose or special purpose computer or a general purpose or special purpose processor. Also, any connection is properly termed a computer-readable medium.
  • a magnetic disk and an optical disk include a compact disk (CD), a laser disk, an optical disk, a digital versatile disk (DVD), a floppy disk, a Blu-ray disk, in which a disk generally reproduces data magnetically, and an optical disk optically reproduces data using a laser. . Combinations of the above should also be included within the scope of computer readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)
  • Document Processing Apparatus (AREA)

Abstract

公开了一种网页重排方法。该方法包括:计算网页中图片内容的排版区域宽度;判断图片内容是否位于网页的文本中;如果图片内容位于网页的文本中,根据显示网页的移动终端屏幕的屏幕尺寸和图片内容的排版区域宽度,对图片内容的排版区域尺寸进行调整。还公开了一种网页重排装置和移动终端。本方案可以使得在页面发生缩放操作时,位于大段文本内的图片会根据屏幕宽度自动缩放并左对齐,由此使得图片可以在屏宽范围内显示并位于文本同一列,从而实现阅读图文时无需左右拖动,提高阅读体验。

Description

网页重排方法、 网页重排装置以及移动终端
技术领域 本发明涉及移动通信领域, 更加具体地, 涉及一种对文本内容中插入有图片内容 的网页进行重排的网页重排方法、 网页重排装置以及具有该网页重排装置的移动终
背景技术
目前, 利用移动终端来浏览比如新浪等门户网站上的新闻逐渐成为一种趋势。但 是, 在通过移动终端浏览网页时, 由于移动终端的屏幕尺寸有限, 很多尺寸较大的图 片无法在一个屏幕里显示,从而使得移动终端用户不得不通过在屏宽范围内上下左右 拖动来完成显示, 由此给移动终端用户带来不佳的阅读体验。
这个问题在阅读一段带有图片的新闻时尤为明显。这是因为, 对于该新闻中的文 字内容, 已经实现了文字根据屏幕宽度自动重排版的技术, 由此大段的文字可以在屏 宽范围内仅使用上下拖动即可完成阅读, 而无需左右拖动。但是, 如果大段文字中插 入了图片, 情况就大不相同。 当阅读到图片的时候, 由于图片比屏幕大, 用户不得不 使用左右拖动来阅读, 并且无法在一个屏幕里看到整幅图片。此外, 令用户体验更糟 糕的是, 文字中所插入的图片一般都是居中的, 当文字被适应屏幕左对齐而图片还是 居中时, 用户阅读图片需要移动很大一段距离。 甚至, 用户仅仅看到一段空白, 而并 没有意识到屏幕向右拖动一段距离后会有一幅图片, 由此会导致用户忽略该图片。 发明内容
鉴于上述问题,本发明的目的是提供一种用于对文本内容中插入有图片内容的网 页进行重排的网页重排方法。
此外,本发明的另一目的是提供一种用于执行上述网页重排方法的网页重排装置 以及具有该网页重排装置的移动终端。
根据本发明的一个方面,提供了一种用于对文本内容中插入有图片内容的网页进 行重排的网页重排方法, 包括: 在对网页中的图片内容重新排版时, 计算该图片内容 的排版区域宽度; 在该图片内容不包含用于指示该图片内容要被使用的属性时,判断 该图片内容是否在大段文本中; 以及在该图片内容位于大段文本中时,根据移动终端 的屏宽尺寸和该图片内容的排版区域宽度, 对该图片内容的排版区域尺寸进行调整。 在上述方面的一个或多个示例中,判断该图片内容是否在大段文本中的步骤可以 包括: 判断该图片内容的父节点是否为用于表示文本内容的节点, 或者判断该图片内 容的兄弟节点是否存在至少两个其它内容节点,其中, 当该图片内容的父节点是用于 表示文本内容的节点, 或者该图片内容的兄弟节点存在至少两个其它内容时,确定该 图片内容位于大段文本中。
在上述方面的一个或多个示例中, 在对该图片内容的排版区域尺寸进行调整之 前,所述方法还可以包括:判断该图片内容的排版区域宽度是否在预设范围内,其中, 在该图片内容的排版区域宽度在所述预设范围内时,根据移动终端的屏宽尺寸,对该 图片内容的排版区域尺寸进行调整。
在上述方面的一个或多个示例中,在完成对该图片内容的排版区域尺寸的调整之 后,所述方法还可以包括: 在该图片内容的图片节点中添加用于指示在排版时强制该 图片内容左对齐的标记。
在上述方面的一个或多个示例中,对该图片内容的排版区域尺寸进行调整的步骤 可以包括:将该图片内容的排版区域的宽度修改为移动终端的屏幕宽度减去预定数目 的像素; 以及根据排版区域宽度的调整, 对该排版区域的高度进行等比例缩放。
根据本发明的另一方面,提供了一种用于对文本内容中插入有图片内容的网页进 行重排的网页重排装置, 包括: 计算单元, 用于在对网页中的图片内容重新排版时, 计算该图片内容的排版区域宽度; 第一判断单元,用于在该图片内容不包含用于指示 该图片内容要被使用的属性时,判断该图片内容是否在大段文本中; 以及尺寸调整单 元, 用于在该图片内容位于大段文本中时, 根据移动终端的屏宽尺寸, 对该图片内容 的排版区域尺寸进行调整。
在上述方面的一个或多个示例中,所述判断单元可以被配置为判断该图片内容的 父节点是否为用于表示文本内容的节点,或者判断该图片内容的兄弟节点是否存在至 少两个其它内容节点, 其中, 当该图片内容的父节点是用于表示文本内容的节点, 或 者该图片内容的兄弟节点存在至少两个其它内容节点时,所述判断单元判断该图片内 容位于大段文本中。
在上述方面的一个或多个示例中, 所述网页重排装置还可以包括第二判断单元, 用于在对该图片内容的排版区域尺寸进行调整之前,判断该图片内容的排版区域宽度 是否在预设范围内, 其中, 在该图片内容的排版区域宽度在所述预设范围内时, 所述 尺寸调整单元根据移动终端的屏宽尺寸, 对该图片内容的排版区域尺寸进行调整。 在上述方面的一个或多个示例中, 所述网页重排装置还可以包括标记添加单元, 用于在所述尺寸调整单元完成排版区域尺寸调整后,在该图片内容的图片节点中添加 用于指示在排版时强制该图片内容左对齐的标记。
在上述方面的一个或多个示例中, 所述尺寸调整单元可以包括: 宽度修改模块, 用于将该图片内容的排版区域的宽度修改为移动终端的屏幕宽度减去预定数目的像 素; 以及高度修改模块, 用于根据排版区域宽度的调整, 对该排版区域的高度进行等 比例缩放。
根据本发明的另一方面, 提供了一种移动终端, 包括如上所述的网页重排装置。 利用上述根据本发明的网页重排方法及网页重排装置,可以在页面发生缩放操作 时, 使得位于大段文本内的图片根据屏幕宽度自动缩放, 从而使得可以在移动终端的 屏宽范围内显示图片,由此避免用户在阅读图文内容时左右拖动,从而提高阅读体验。 此外,通过在图片内容的图片节点中添加用于指示在排版时强制该图片内容左对齐的 标记, 可以使得图片可以在屏宽范围内与文本同列显示, 从而进一步提高阅读体验。
为了实现上述以及相关目的,本发明的一个或多个方面包括后面将详细说明并在 权利要求中特别指出的特征。下面的说明以及附图详细说明了本发明的某些示例性方 面。然而, 这些方面指示的仅仅是可使用本发明的原理的各种方式中的一些方式。此 夕卜, 本发明旨在包括所有这些方面以及它们的等同物。 附图说明 根据下述参照附图进行的详细描述, 本发明的上述和其他目的、特征和优点将变 得更加显而易见。 在附图中:
图 1 示出了根据本发明的实施例的用于对文本内容中插入有图片内容的网页进 行重排的网页重排方法的一个示例的流程图;
图 2是示出当前浏览的插入有图片内容的文本内容的显示结果的示图; 图 3是在图片内容的显示区域放大后,利用根据本发明的网页重排方法对图 2中 示出的显示结果进行网页重排后的显示结果的示图;
图 4是在图片内容的显示区域放大后,利用根据本发明的网页重排方法对图 2中 示出的显示结果进行网页重排后的显示结果的示图;
图 5是在移动终端的屏幕宽度放大后,利用根据本发明的网页重排方法对图 2中 示出的显示结果进行网页重排后的显示结果的示图;
图 6是当前浏览的网页内容的显示结果的示图; 图 7是对图 6中的一幅图片进行放大显示后根据本发明的方法进行网页重排后得 到的结果的示图;
图 8是对图 7中页面进行缩小后,根据本发明的方法进行网页重排后得到的结果 的示图;
图 9 是根据本发明的实施例的用于对文本内容中插入有图片内容的网页进行重 排的网页重排装置的一个示例的方框示意图; 和
图 10是具有根据本发明的网页重排装置的移动终端的方框示意图。
在所有附图中相同的标号指示相似或相应的特征或功能。 具体实施方式
以下将结合附图对本发明的具体实施例进行详细描述。
图 1 示出了根据本发明的实施例的用于对文本内容中插入有图片内容的网页进 行重排的网页重排方法的一个示例的流程图。
如图 1所示, 首先, 在步骤 S110中, 判断是否需要对网页中的图片内容进行重 排。例如, 判断要在移动终端上显示的图片内容的显示大小是否发生改变, 或者判断 移动终端的屏幕宽度是否发生改变。在要在移动终端上显示的图片内容的显示大小发 生变化时,例如图片内容的显示区域放大或缩小,确定需要对网页中的图片内容进行 重排。 或者, 在移动终端的屏幕宽度发生变化时, 例如, 如果移动终端从竖屏显示改 变为横屏显示, 或者从横屏显示改变为竖屏显示, 则确定需要对网页中的图片内容进 行重排。 如果判断为不需要重排, 则流程结束。
在确定为需要对网页中的图片内容重新排版时, 在步骤 S120, 计算该图片内容 的排版区域宽度。 例如, 在依照 DOM树的结构依次遍历和排版时, 在排版流程中存 在一个计算节点所占排版区域的过程, 该区域就是网页中描述的图片的尺寸, 也是在 普通桌面浏览器上渲染该图片节点时该图片节点的尺寸。也就是说,可以通过分析网 页的描述语言来计算出图片内容的排版区域宽度。
随后, 在步骤 S130, 判断该图片内容是否包含用于指示该图片内容要被使用的 属性以及该图片内容是否在大段文本中。所述用于指示该图片内容要被使用的属性例 如包括 usemap属性。 如果图片内容包含该类属性, 则对图片尺寸进行修改时可能会 破坏事件触发逻辑, 比如鼠标点击事件的逻辑。此外, 判断该图片内容是否包含在大 段文本中, 可以采用下述方式来确定。例如, 判断该图片内容的父节点是否为用于表 示文本内容的节点,例如判断父节点中是否包含用于表示文本内容的一个段落的标签 <p>或标签 <font>,或者判断该图片内容的兄弟节点是否存在至少两个其它内容节点, 比如文本节点、 <br>节点或图片节点。其中, 当该图片内容的父节点是用于表示文本 内容的节点, 例如包含用于表示文本内容的一个段落的标签 <p>或标签 <font>, 或者 该图片内容的兄弟节点存在至少两个其它文本节点、 <br>节点或图片节点时, 确定该 图片内容位于大段文本中。 否则, 则认为该图片内容不在大段文本中。
在该图片内容包含用于指示该图片内容要被使用的属性时或者该图片内容不在 大段文本中时, 即, 步骤 S130的判断结果为否时, 流程结束。 在该图片内容不包含 用于指示该图片内容将要被使用的属性且位于大段文本中时, 即, 步骤 S130的判断 结果为是时, 流程进行到步骤 S140。
在步骤 S140, 判断该图片内容的排版区域宽度是否在预设范围内。 所述预设范 围可以根据移动终端的屏幕宽度设置。通常, 对于竖屏显示, 该预设范围被设置为小 于 950像素以及大于 120像素。利用该预设范围,可以过滤本来就不会超出屏宽的较 小图片以及尺寸较大的网站 Log和广告。当移动终端的屏幕宽度变化时,该预设范围 也发生变化。 例如, 当屏幕宽度从竖屏变为宽屏时, 上述预设范围中的下限会变大。
在该图片内容的排版区域宽度在所述预设范围内时, 进行到步骤 S150。 否则, 流程结束。
在步骤 S150, 根据移动终端的屏宽尺寸, 对该图片内容的排版区域尺寸进行调 整。 在一个示例中, 例如, 对该图片内容的排版区域尺寸进行调整时可以包括: 将该 图片内容的排版区域的宽度修改为移动终端的屏幕宽度减去预定数目的像素;以及根 据排版区域宽度的调整, 对该排版区域的高度进行等比例缩放。这里, 预定数目的像 素可以根据需要自由设定, 通常设置为 20像素。 很显然, 上述示例仅仅是一个例示。 本领域技术人员还可以采用其它合适的方式,基于图片内容的排版区域宽度以及移动 终端的屏宽尺寸, 对该图片内容的排版区域尺寸进行屏幕自适应调整。注意, 这里的 高度调整是按照宽度尺寸的调整等比例调整的。另外,这里调整的只是图片的显示宽 度, 是在图片渲染阶段做缩放再绘画出来, 而不是把图片的原始数据做缩放后替换原 来的图片数据, 从而不会使得图片缩小再放大后导致失真。
此外, 优选地, 在如上完成对该图片内容的排版区域尺寸的调整之后, 所述方法 还可以包括步骤 S160。 在步骤 S160, 在该图片内容的图片节点中添加用于指示在排 版时强制该图片内容左对齐的标记。该标记是对浏览器内核 DOM树节点属性的扩展, 当排版过程中遇到这个标记时, 会忽略 text-align、 indent, margin等属性造成元素不 左对齐的影响, 从而达到让图片和文字居于同一列的目的。 此外, 优选地, 在步骤 S150和 S160之间, 还可以包括判断图片内容显示是否居 中。 在判断为图片内容显示居中时, 进行到步骤 S160。 否则, 返回到步骤 S150, 重 新对图片内容的排版区域尺寸进行调整, 直到图片内容显示居中为止。
如上参照图 1 对根据本发明的实施例的用于对文本内容中插入有图片内容的网 页进行重排的网页重排方法进行了描述。这里要说明的是, 上述实施例仅仅是用于示 例本发明, 而不是对本发明的限制。
本领域的技术人员还可以对上述实施例进行各种修改。例如, 在一个示例中, 可 以省略上述的网页图片重排判断步骤 S110, 也就是说, 在已经认为网页图片需要进 行重排的情况下, 进行本发明的网页重排过程。
此外, 在本发明的另一示例中, 也可以省略步骤 S140。 也就是说, 对于任何满 足前述条件的网页图片都进行尺寸调整。此外, 在另一示例中, 在网页图片已经是左 对齐的情况下, 也可以省略步骤 S160。
下面利用实例来对根据本发明的网页重排方法的效果进行说明。
图 2 是示出根据一个实例的当前浏览的插入有图片内容的文本内容的显示结果 的示图。 图 3是在图片内容的显示区域放大后,利用根据本发明的网页重排方法对图 2中示出的显示结果进行网页重排后的显示结果的示图。 图 4是在图片内容的显示区 域放大后,利用根据本发明的网页重排方法对图 2中示出的显示结果进行网页重排后 的显示结果的示图。 图 5是在移动终端的屏幕宽度放大后,利用根据本发明的网页重 排方法对图 2中示出的显示结果进行网页重排后的显示结果的示图。
在图 2中, 示出了一篇普通的新闻, 该新闻的主题部分带有两幅图片, 两幅图片 均是尺寸较大的图片, 按照默认的缩放比例把页面放大后,两幅图均不能在一个屏幕 范围里完整显示。
图 3是对图 2中的第一幅图的显示区域放大,放大过程中浏览器内核会触发网页 重排, 重排过程中会触发图片尺寸自动缩放处理(即, 根据本发明的网页图片重排), 由此相关的图片会根据屏幕的宽度自动缩小, 并且由原来的居中变成左对齐,和上下 文字居于同一列。
在图 3的显示内容的基础上, 再向下拖动到新闻的第二幅图片, 如图 4所示, 可 以看到第二幅图同样是被缩小到屏幕宽度内并且左对齐的。在这个拖动过程中, 并没 有触发重排版, 因为之前从缩略图到放大某一区域的操作中, 已经对整个页面进行重 排, 所有应该被触发自动缩放的图片已经完成重排操作。
图 5是在移动终端显示屏幕从竖屏变为横屏时触发的重排结果。由于屏幕的屏宽 改变, 页面会触发重排, 所有需要做自动缩放的图片也会调整尺寸。 如图 5所示, 所 显示出的图片的尺寸比竖屏显示时更大, 但依然在屏宽范围内。
图 6是示出根据另一实例的当前浏览的网页内容的显示结果的示图。图 7是对图 6 中的一幅图片进行放大显示后根据本发明的方法进行网页重排后得到的结果的示 图。 图 8是对图 7中页面进行缩小后,根据本发明的方法进行网页重排后得到的结果 的示图。
图 6示出了一篇文章的缩略图。图 7是在对图 6中的一个图片进行点击放大后进 行页面重排后得到的示图。图 8是对图 7中页面进行缩小从而使得在一屏内容纳更多 文字后得到的示例,在该示图中,所有符合自动缩放条件的图片都被重新缩放到适合 屏宽显示。
如上参考图 1到图 8描述了根据本发明的网页重排方法,本发明的上述网页重排 方法,可以采用软件实现,也可以采用硬件实现,或采用软件和硬件组合的方式实现。
图 9 示出了根据本发明的实施例的用于对文本内容中插入有图片内容的网页进 行重排的网页重排装置 900的一个示例的方框示意图。
如图 9所示, 所述网页重排装置 900包括网页重排确定单元 910、计算单元 920、 第一判断单元 930、 第二判断单元 940、 尺寸调整单元 950以及标记添加单元 960。
所述网页重排确定单元 910用于确定是否需要对网页中的图片内容进行重排。例 如,判断要在移动终端上显示的图片内容的显示大小是否发生改变, 或者判断移动终 端的屏幕宽度是否发生改变。在要在移动终端上显示的图片内容的显示大小发生变化 时, 例如图片内容的显示区域放大或缩小, 确定需要对网页中的图片内容进行重排。 或者, 在移动终端的屏幕宽度发生变化时, 例如, 如果移动终端从竖屏显示改变为横 屏显示,或者从横屏显示改变为竖屏显示,则确定需要对网页中的图片内容进行重排。 此外,在本发明的一个替换示例中, 也可以不包括所述网页重排确定单元 910。例如, 例如,在任何情况下都对网页中的图片内容进行网页重排, 或者在已经预先确定出或 者认为该网页的图片内容需要进行重排的情况下。
所述计算单元 920用于在对网页中的图片内容重新排版时,计算该图片内容的排 版区域宽度。 如果计算图片内容的排版区域宽度, 参见上面的描述。
所述第一判断单元 930 用于在该图片内容不包含用于指示该图片内容要被使用 的属性时,判断该图片内容是否在大段文本中。判断该图片内容是否包含在大段文本 中, 可以采用下述方式来确定。例如, 判断该图片内容的父节点是否为用于表示文本 内容的节点, 例如判断该父节点是否包含用于表示文本内容的一个段落的标签 <p>或 标签 <font>, 或者判断该图片内容的兄弟节点是否存在至少两个其它内容节点, 比如 文本节点、 <br>节点或图片节点。其中, 当该图片内容的父节点是用于表示文本内容 的节点, 例如该父节点包含用于表示文本内容的一个段落的标签 <p>或标签 <font>, 或者该图片内容的兄弟节点存在至少两个其它文本节点、 <br>节点或图片节点时, 确 定该图片内容位于大段文本中。
在判断出图片内容存在于大段文本中后,所述第二判断单元 940判断该图片内容 的排版区域宽度是否在预设范围内。 所述预设范围可以根据移动终端的屏幕宽度设 置。 当移动终端的屏幕宽度变化时, 该预设范围也发生变化。
在该图片内容的排版区域宽度在所述预设范围内时,所述尺寸调整单元 950根据 移动终端的屏宽尺寸, 对该图片内容的排版区域尺寸进行调整。在一个示例中, 所述 尺寸调整单元包括: 宽度修改模块 (未示出), 用于将该图片内容的排版区域的宽度 修改为移动终端的屏幕宽度减去预定数目的像素; 以及高度修改模块 (未示出), 用 于根据排版区域宽度的调整, 对该排版区域的高度进行等比例缩放。
在所述尺寸调整单元完成排版区域尺寸调整后,所述标记添加单元 960在该图片 内容的图片节点中添加用于指示在排版时强制该图片内容左对齐的标记。
图 9中示出的网页重排装置 900仅仅是本发明的网页重排装置的一个示例,本领 域的技术人员可以按照与上述方法中的修改类似的方式对图 9 中示出的网页重排装 置 900进行各种修改。
利用本发明的网页重排方法及装置, 可以在页面发生缩放操作时, 使得位于大段 文本内的图片根据屏幕宽度自动缩放,从而使得可以在移动终端的屏宽范围内显示图 片, 由此避免用户在阅读图文内容时左右拖动, 从而提高阅读体验。 此外, 通过在图 片内容的图片节点中添加用于指示在排版时强制该图片内容左对齐的标记,可以使得 图片可以在屏宽范围内与文本同列显示, 从而进一步提高阅读体验。
图 10是具有根据本发明的网页重排装置 900的移动终端 10的方框示意图。如图 10所示, 移动终端 10包括如上所述的网页重排装置 900。 很显然, 图 10中的网页重 排装置也可以包括图 9中示出的网页重排装置 900的各种变型。
此外, 典型地, 本发明所述的移动终端可为各种手持终端设备, 例如手机、 个人 数字助理 (PDA) 等, 因此本发明的保护范围不应限定为某种特定类型的移动终端。
此外, 根据本发明的方法还可以被实现为由 CPU执行的计算机程序。 在该计算 机程序被 CPU执行时, 执行本发明的方法中限定的上述功能。
此外, 上述方法步骤以及系统单元也可以利用控制器(例如, 处理器) 以及用于 存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储设备实现。 此外, 应该明白的是, 本文所述的计算机可读存储设备 (例如, 存储器)可以是 易失性存储器或非易失性存储器, 或者可以包括易失性存储器和非易失性存储器两 者。 作为例子而非限制性的, 非易失性存储器可以包括只读存储器 (ROM)、 可编程 ROM (PROM)、 电可编程 ROM (EPROM)、 电可擦写可编程 ROM (EEPROM) 或 快闪存储器。 易失性存储器可以包括随机存取存储器 (RAM), 该 RAM可以充当外 部高速缓存存储器。 作为例子而非限制性的, RAM可以以多种形式获得, 比如同步 RAM (DRAM)、动态 RAM (DRAM)、同步 DRAM ( SDRAM )、双数据速率 SDRAM (DDR SDRAM )、 ±曾强 SDRAM (ESDRAM)、 同步链路 DRAM ( SLDRAM) 以及 直接 Rambus RAM (DRRAM)。 所公开的方面的存储设备意在包括但不限于这些和 其它合适类型的存储器。
本领域技术人员还将明白的是, 结合这里的公开所描述的各种示例性逻辑块、模 块、 电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。 为了清楚地 说明硬件和软件的这种可互换性, 已经就各种示意性组件、 方块、 模块、 电路和步骤 的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于 具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以 各种方式来实现所述的功能, 但是这种实现决定不应被解释为导致脱离本发明的范 围。
结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于 执行这里所述功能的下列部件来实现或执行: 通用处理器、 数字信号处理器(DSP)、 专用集成电路 (ASIC)、 现场可编程门阵列 (FPGA) 或其它可编程逻辑器件、 分立 门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处 理器, 但是可替换地, 处理器可以是任何传统处理器、 控制器、 微控制器或状态机。 处理器也可以被实现为计算设备的组合, 例如, DSP和微处理器的组合、多个微处理 器、 一个或多个微处理器结合 DSP核、 或任何其它这种配置。
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、由处理器执 行的软件模块中或这两者的组合中。软件模块可以驻留在 RAM存储器、快闪存储器、 ROM存储器、 EPROM存储器、 EEPROM存储器、寄存器、硬盘、可移动盘、 CD-ROM、 或本领域已知的任何其它形式的存储介质中。示例性的存储介质被耦合到处理器, 使 得处理器能够从该存储介质中读取信息或向该存储介质写入信息。 在一个替换方案 中,所述存储介质可以与处理器集成在一起。处理器和存储介质可以驻留在 ASIC中。 ASIC可以驻留在用户终端中。 在一个替换方案中, 处理器和存储介质可以作为分立 组件驻留在用户终端中。
在一个或多个示例性设计中, 所述功能可以在硬件、 软件、 固件或其任意组合中 实现。如果在软件中实现, 则可以将所述功能作为一个或多个指令或代码存储在计算 机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机存储介质和 通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何 介质。存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非 限制性的, 该计算机可读介质可以包括 RAM、 ROM、 EEPROM、 CD-ROM或其它 光盘存储设备、磁盘存储设备或其它磁性存储设备, 或者是可以用于携带或存储形式 为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处 理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机可读介质。例如, 如果使用同轴线缆、 光纤线缆、 双绞线、 数字用户线路 (DSL) 或诸如红外线、 无线 电和微波的无线技术来从网站、服务器或其它远程源发送软件, 则上述同轴线缆、光 纤线缆、 双绞线、 DSL 或诸如红外先、 无线电和微波的无线技术均包括在介质的定 义。 如这里所使用的, 磁盘和光盘包括压缩盘(CD)、 激光盘、 光盘、 数字多功能盘 (DVD)、 软盘、 蓝光盘, 其中磁盘通常磁性地再现数据, 而光盘利用激光光学地再 现数据。 上述内容的组合也应当包括在计算机可读介质的范围内。
如上参照附图以示例的方式描述根据本发明的实施例。但是, 本领域技术人员应 当理解,对于本发明的上述实施例,还可以在不脱离本发明内容的基础上做出各种改 进。 因此, 本发明的保护范围应当由所附的权利要求书的内容确定。

Claims

权利要求书
1、 一种网页重排方法, 包括:
计算网页中的图片内容的排版区域宽度;
判断该图片内容是否位于该网页的文本中;
如果该图片内容位于该网页的文本中,根据显示该网页的移动终端屏幕的屏 宽尺寸和该图片内容的排版区域宽度, 对该图片内容的排版区域尺寸进行调整。
2、 如权利要求 1所述的网页重排方法, 还包括:
判断是否需要对网页中的图片内容进行重排, 如果判断结果为是, 则执行所 述计算网页中的图片内容的排版区域宽度的步骤; 其中,
判断是否需要对网页中的图片内容进行重排包括:
判断网页中的图片内容的显示大小是否发生改变, 或者, 判断移动终端屏幕 的屏幕宽度是否发生改变。
3、 如权利要求 1所述的网页重排方法, 还包括:
判断该图片内容是否包含用于指示该图片内容要被使用的属性,如果判断结 果为否, 则执行所述判断该图片内容是否位于该网页的文本中的步骤。
4、 如权利要求 1所述的网页重排方法, 其中, 判断该图片内容是否位于该 网页的文本中的步骤包括:
判断该图片内容的父节点是否为用于表示文本内容的节点,当该图片内容的 父节点是用于表示文本内容的节点时, 确定该图片内容位于该网页的文本中; 或者, 判断该图片内容的兄弟节点是否存在至少两个其它内容节点, 当该图 片内容的兄弟节点存在至少两个其它内容节点时,确定该图片内容位于该网页的 文本中。
5、 如权利要求 1所述的网页重排方法, 所述方法还包括:
判断该图片内容的排版区域宽度是否在预设范围内, 如果判断结果为是, 则 执行所述对该图片内容的排版区域尺寸进行调整的步骤。
6、 如权利要求 1所述的网页重排方法, 其中, 对该图片内容的排版区域尺 寸进行调整的步骤包括:
将该图片内容的排版区域宽度修改为该移动终端屏幕的屏幕宽度减去预定 数目的像素;
根据该排版区域宽度的修改, 对该排版区域的高度进行等比例缩放。
7、 如权利要求 1所述的网页重排方法, 所述方法还包括:
在对该图片内容的排版区域尺寸进行调整后,在该图片内容的图片节点中添 加用于指示在排版时强制该图片内容左对齐的标记。
8、 一种网页重排装置, 包括:
计算单元, 用于计算图片内容的排版区域宽度;
第一判断单元, 用于判断该图片内容是否位于该网页的文本中; 尺寸调整单元, 用于如果该图片内容位于该网页的文本中, 根据显示该网页 的移动终端屏幕的屏宽尺寸和该图片内容的排版区域宽度,对该图片内容的排版 区域尺寸进行调整。
9、 如权利要求 8所述的网页重排装置, 还包括:
重排确定单元, 用于判断是否需要对网页中的图片内容进行重排, 如果判断 结果为是, 则触发所述计算单元执行计算图片内容的排版区域宽度; 其中, 所述重排确定单元,具体用于判断网页中的图片内容的显示大小是否发生改 变, 或者, 判断移动终端屏幕的屏幕宽度是否发生改变。
10、 如权利要求 8所述的网页重排装置, 其中,
第一判断单元,还用于判断该图片内容是否包含用于指示该图片内容要被使 用的属性, 如果判断结果为否, 则执行所述判断该图片内容是否位于该网页的文 本中。
11、 如权利要求 8所述的网页重排装置, 其中,
第一判断单元,具体用于判断该图片内容的父节点是否为用于表示文本内容 的节点, 当该图片内容的父节点是用于表示文本内容的节点时, 确定该图片内容 位于该网页的文本中,或者判断该图片内容的兄弟节点是否存在至少两个其它内 容节点, 当该图片内容的兄弟节点存在至少两个其它内容节点时, 确定该图片内 容位于该网页的文本中。
12、 如权利要求 8所述的网页重排装置, 还包括:
第二判断单元, 用于判断该图片内容的排版区域宽度是否在预设范围内, 如 果判断结果为是,则触发所述尺寸调整单元执行对该图片内容的排版区域尺寸进 行调整。
13、 如权利要求 8所述的网页重排装置, 还包括:
标记添加单元,用于在所述尺寸调整单元对该图片内容的排版区域尺寸进行 调整后,在该图片内容的图片节点中添加用于指示在排版时强制该图片内容左对 齐的标记。
14、 如权利要求 8所述的网页重排装置, 其中, 该尺寸调整单元包括: 宽度修改模块,用于将该图片内容的排版区域宽度修改为该移动终端屏幕的 屏幕宽度减去预定数目的像素;
高度修改模块, 用于根据宽度修改模块对该排版区域宽度的修改, 对该排版 区域的高度进行等比例缩放。
15、 一种移动终端, 包括如权利要求 8到 14中任何一个所述的网页重排装 置。
PCT/CN2012/086935 2011-12-29 2012-12-19 网页重排方法、网页重排装置以及移动终端 WO2013097638A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/130,463 US9886519B2 (en) 2011-12-29 2012-12-19 Methods and systems for adjusting webpage layout

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110451006.7A CN102591853B (zh) 2011-12-29 2011-12-29 网页重排方法、网页重排装置以及移动终端
CN201110451006.7 2011-12-29

Publications (1)

Publication Number Publication Date
WO2013097638A1 true WO2013097638A1 (zh) 2013-07-04

Family

ID=46480522

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/086935 WO2013097638A1 (zh) 2011-12-29 2012-12-19 网页重排方法、网页重排装置以及移动终端

Country Status (3)

Country Link
US (1) US9886519B2 (zh)
CN (1) CN102591853B (zh)
WO (1) WO2013097638A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324738A (zh) * 2013-06-28 2013-09-25 北京奇虎科技有限公司 一种电子设备上网页缩放后对齐的方法和装置
CN113283214A (zh) * 2021-06-02 2021-08-20 湖南通远网络股份有限公司 一种基于定性要求的格式自规划系统
CN113283214B (zh) * 2021-06-02 2024-06-04 湖南通远网络股份有限公司 一种基于定性要求的格式自规划系统

Families Citing this family (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591853B (zh) * 2011-12-29 2015-04-01 优视科技有限公司 网页重排方法、网页重排装置以及移动终端
US20140059424A1 (en) * 2012-08-22 2014-02-27 Lg Cns Co., Ltd. Responsive user interface for display devices
WO2014029101A1 (en) * 2012-08-24 2014-02-27 Intel Corporation Method, apparatus and system for displaying file
CN102955769A (zh) * 2012-11-05 2013-03-06 福州锐达数码科技有限公司 将交互式电子白板软件中的对象插入到PowerPoint页面中的方法
CN102981833B (zh) * 2012-11-05 2015-06-03 福州锐达数码科技有限公司 将交互式电子白板软件中的对象插入到Office页面中的方法
CN103064920B (zh) * 2012-12-20 2014-03-05 优视科技有限公司 移动终端中的页面字体大小缩放方法及装置
CN103942202B (zh) * 2013-01-18 2018-01-30 腾讯科技(深圳)有限公司 网页文本域高度自适应缩放方法及装置
CN103150302B (zh) * 2013-03-19 2016-04-13 小米科技有限责任公司 一种排版方法和装置
CN103324454B (zh) * 2013-05-23 2016-12-28 百度在线网络技术(北京)有限公司 用于检测目标区域中排列错位的显示元素的方法和设备
US10061494B2 (en) * 2013-06-28 2018-08-28 Beijing Qihoo Technology Company Limited Method and device for webpage zooming on electronic apparatus
CN104281439B (zh) * 2013-07-02 2016-12-21 腾讯科技(深圳)有限公司 终端的标识显示方法和装置
CN104572667A (zh) * 2013-10-15 2015-04-29 富泰华工业(深圳)有限公司 网页服务系统、网页服务器及网页提供方法
CN104965833B (zh) * 2014-06-13 2018-10-02 腾讯科技(深圳)有限公司 一种浏览器窗口中的页面显示方法及装置
CN105205077A (zh) * 2014-06-25 2015-12-30 广州市动景计算机科技有限公司 页面排版方法、装置及系统
CN104133623B (zh) * 2014-06-27 2017-06-16 小米科技有限责任公司 页面缩放方法和装置
CN105389159A (zh) * 2014-09-03 2016-03-09 优视科技有限公司 图片渲染方法、装置和移动终端
KR20160084629A (ko) * 2015-01-06 2016-07-14 삼성전자주식회사 콘텐트 표시 방법 및 이를 구현하는 전자 장치
CN104978428A (zh) * 2015-07-10 2015-10-14 无锡天脉聚源传媒科技有限公司 一种显示资源的摘要图片的方法和装置
CN105979393A (zh) * 2015-12-01 2016-09-28 乐视致新电子科技(天津)有限公司 网页页面的显示方法和装置、及智能电视系统
CN105630746A (zh) * 2015-12-21 2016-06-01 华为技术有限公司 页面显示的方法和终端设备
CN107704468A (zh) * 2016-08-08 2018-02-16 广州市动景计算机科技有限公司 页面显示方法、装置和客户端设备
US10210144B2 (en) * 2016-08-16 2019-02-19 Adobe Inc. Creation and display of a webpage with alternative layouts for different webpage widths
CN106503129A (zh) * 2016-10-20 2017-03-15 福建中金在线信息科技有限公司 一种在网页文章中展示图片的方法及装置
US10360288B2 (en) 2017-01-25 2019-07-23 International Business Machines Corporation Web page design snapshot generator
CN108280107B (zh) * 2017-03-08 2022-01-14 阿里巴巴(中国)有限公司 网页处理方法、装置及用户终端
EP3435250A1 (en) * 2017-07-27 2019-01-30 Vestel Elektronik Sanayi ve Ticaret A.S. Method, apparatus and computer program for overlaying a web page on a 3d object
CN107357938B (zh) * 2017-08-23 2021-02-05 北京奇虎科技有限公司 一种网页展示方法和装置
CN107562862A (zh) * 2017-08-29 2018-01-09 合肥尚西网络科技有限公司 一种广告展示装置
CN109710866B (zh) * 2018-12-18 2021-07-02 天津字节跳动科技有限公司 在线文档内图片显示方法和装置
CN109741424A (zh) * 2018-12-29 2019-05-10 北京金山安全软件有限公司 一种在文字周围插入图片的方法、装置及电子设备
CN111061975B (zh) * 2019-12-13 2021-09-07 腾讯科技(深圳)有限公司 一种页面中无关内容的处理方法、装置
CN111552428B (zh) * 2020-04-29 2021-12-14 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机设备以及存储介质
CN113343151A (zh) * 2021-06-25 2021-09-03 上海渠杰信息科技有限公司 一种网页视图的处理方法及设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002007269A (ja) * 2000-06-27 2002-01-11 Kddi Research & Development Laboratories Inc ページを再編集するプロキシサーバ、方法及びプログラムを記録した記録媒体
US20040255244A1 (en) * 2003-04-07 2004-12-16 Aaron Filner Single column layout for content pages
CN1630398A (zh) * 2003-12-17 2005-06-22 株式会社Ntt都科摩 用于按比例调整在移动通信终端之间传送的图像的尺寸的方法和装置
CN1967522A (zh) * 2005-11-18 2007-05-23 财团法人资讯工业策进会 网页数据显示的转换方法以及系统
CN101535938A (zh) * 2006-09-06 2009-09-16 苹果公司 用于显示结构化电子文档的便携式电子设备、方法和图形用户界面
CN101539934A (zh) * 2009-03-30 2009-09-23 北京跳网无限科技发展有限公司 在wap网页中插入广告的方法
CN101950239A (zh) * 2010-09-14 2011-01-19 北京神州泰岳软件股份有限公司 大尺寸图像显示方法及系统
CN102591853A (zh) * 2011-12-29 2012-07-18 优视科技有限公司 网页重排方法、网页重排装置以及移动终端

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3298556B2 (ja) * 1999-05-14 2002-07-02 株式会社デンソー 表示装置
US6546397B1 (en) * 1999-12-02 2003-04-08 Steven H. Rempell Browser based web site generation tool and run time engine
CN100486280C (zh) * 2005-02-02 2009-05-06 中国移动通信集团公司 移动通信终端页面适配的方法及系统
CN100466778C (zh) * 2005-05-20 2009-03-04 英华达(上海)电子有限公司 手机中大图片mms使用roi图像压缩进行编辑处理的方法
JP4732029B2 (ja) * 2005-06-29 2011-07-27 キヤノン株式会社 レイアウト決定方法および情報処理装置およびレイアウト決定プログラム
KR100724956B1 (ko) * 2005-12-13 2007-06-04 삼성전자주식회사 이동 통신 단말의 배경화면 표시 방법
US20080033996A1 (en) * 2006-08-03 2008-02-07 Anandsudhakar Kesari Techniques for approximating the visual layout of a web page and determining the portion of the page containing the significant content
US20080072139A1 (en) * 2006-08-20 2008-03-20 Robert Salinas Mobilizing Webpages by Selecting, Arranging, Adapting, Substituting and/or Supplementing Content for Mobile and/or other Electronic Devices; and Optimizing Content for Mobile and/or other Electronic Devices; and Enhancing Usability of Mobile Devices
JP4771915B2 (ja) * 2006-11-15 2011-09-14 京セラミタ株式会社 Htmlテキストを変換する装置、方法、およびプログラム
US7523223B2 (en) * 2006-11-16 2009-04-21 Sap Ag Web control simulators for mobile devices
JP4956202B2 (ja) * 2007-01-16 2012-06-20 キヤノン株式会社 情報処理装置及び情報処理方法及びプログラム
US20080301545A1 (en) * 2007-06-01 2008-12-04 Jia Zhang Method and system for the intelligent adaption of web content for mobile and handheld access
KR100815530B1 (ko) * 2007-07-20 2008-04-15 (주)올라웍스 유해성 컨텐츠 필터링 방법 및 시스템
US20090198538A1 (en) * 2008-02-05 2009-08-06 Yahoo! Inc. Mobile advertisement filtering
US8621520B2 (en) * 2009-05-19 2013-12-31 Qualcomm Incorporated Delivery of selective content to client applications by mobile broadcast device with content filtering capability
US8933962B2 (en) * 2010-11-15 2015-01-13 Microsoft Corporation Clipart cartoon techniques
WO2012081609A1 (ja) * 2010-12-14 2012-06-21 シャープ株式会社 画像フィルタ装置、復号装置、符号化装置、および、データ構造
US9385946B2 (en) * 2012-07-26 2016-07-05 At&T Intellectual Property I, L.P. Network-based content filtering utilizing user-specified parameters

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002007269A (ja) * 2000-06-27 2002-01-11 Kddi Research & Development Laboratories Inc ページを再編集するプロキシサーバ、方法及びプログラムを記録した記録媒体
US20040255244A1 (en) * 2003-04-07 2004-12-16 Aaron Filner Single column layout for content pages
CN1630398A (zh) * 2003-12-17 2005-06-22 株式会社Ntt都科摩 用于按比例调整在移动通信终端之间传送的图像的尺寸的方法和装置
CN1967522A (zh) * 2005-11-18 2007-05-23 财团法人资讯工业策进会 网页数据显示的转换方法以及系统
CN101535938A (zh) * 2006-09-06 2009-09-16 苹果公司 用于显示结构化电子文档的便携式电子设备、方法和图形用户界面
CN101539934A (zh) * 2009-03-30 2009-09-23 北京跳网无限科技发展有限公司 在wap网页中插入广告的方法
CN101950239A (zh) * 2010-09-14 2011-01-19 北京神州泰岳软件股份有限公司 大尺寸图像显示方法及系统
CN102591853A (zh) * 2011-12-29 2012-07-18 优视科技有限公司 网页重排方法、网页重排装置以及移动终端

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324738A (zh) * 2013-06-28 2013-09-25 北京奇虎科技有限公司 一种电子设备上网页缩放后对齐的方法和装置
CN113283214A (zh) * 2021-06-02 2021-08-20 湖南通远网络股份有限公司 一种基于定性要求的格式自规划系统
CN113283214B (zh) * 2021-06-02 2024-06-04 湖南通远网络股份有限公司 一种基于定性要求的格式自规划系统

Also Published As

Publication number Publication date
US9886519B2 (en) 2018-02-06
US20140298156A1 (en) 2014-10-02
CN102591853B (zh) 2015-04-01
CN102591853A (zh) 2012-07-18

Similar Documents

Publication Publication Date Title
WO2013097638A1 (zh) 网页重排方法、网页重排装置以及移动终端
US7900137B2 (en) Presenting HTML content on a screen terminal display
WO2014094459A1 (zh) 移动终端中的页面字体大小缩放方法及装置
US9501581B2 (en) Method and apparatus for webpage reading based on mobile terminal
US9378188B2 (en) Method and device for dynamically wrapping text when displaying a selected region of an electronic document
US7516402B2 (en) Presentation of large objects on small displays
US9824137B2 (en) Block zoom on a mobile electronic device
US10366147B2 (en) Techniques for programmatic magnification of visible content elements of markup language documents
US20130145252A1 (en) Page based navigation and presentation of web content
WO2014206072A1 (zh) 预览网页的方法及系统
WO2015078159A1 (zh) 网页显示方法及装置
WO2012159563A1 (zh) 基于移动终端的网页排版方法和装置
US20130246911A1 (en) Method and device for rearranging paragraphs of webpage picture content
US20090313574A1 (en) Mobile document viewer
WO2015196822A1 (zh) 一种网页适应屏幕排版方法及装置
US9727293B1 (en) Method and apparatus for paginating electronic documents
CN112287258A (zh) 页面渲染方法、装置、设备和存储介质
CN111581570A (zh) 一种页面布局方法及计算设备
CN104536949A (zh) 网页重排方法、网页重排装置以及移动终端
JP5715172B2 (ja) 文書表示装置、文書表示方法及び文書表示プログラム
WO2005038673A1 (en) Presenting html content on a screen terminal display
JP2014215721A (ja) 文書ファイルを表示させるコンピュータ、方法およびプログラム
CN112434487A (zh) 一种图文排版方法、装置及电子设备
TW201514842A (zh) 依據顯示裝置之瀏覽器大小而自動改變網頁排版的方法及系統

Legal Events

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

Ref document number: 12862821

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14130463

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12862821

Country of ref document: EP

Kind code of ref document: A1