CN106708371B - Method and system for realizing focus control of browser - Google Patents

Method and system for realizing focus control of browser Download PDF

Info

Publication number
CN106708371B
CN106708371B CN201710031865.8A CN201710031865A CN106708371B CN 106708371 B CN106708371 B CN 106708371B CN 201710031865 A CN201710031865 A CN 201710031865A CN 106708371 B CN106708371 B CN 106708371B
Authority
CN
China
Prior art keywords
dom tree
focus
node
webpage
adjacent node
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.)
Active
Application number
CN201710031865.8A
Other languages
Chinese (zh)
Other versions
CN106708371A (en
Inventor
刘卫平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital Technology Co Ltd
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 Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN201710031865.8A priority Critical patent/CN106708371B/en
Publication of CN106708371A publication Critical patent/CN106708371A/en
Priority to PCT/CN2017/110060 priority patent/WO2018133504A1/en
Application granted granted Critical
Publication of CN106708371B publication Critical patent/CN106708371B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a browser focus control implementation method and a browser focus control implementation system, wherein the method comprises the following steps: when the webpage is loaded, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage; numbering the initial focus and all visible dom tree nodes in the webpage in an ascending order, and sequentially acquiring the numbering information of the initial focus and adjacent nodes of all visible dom tree nodes in the webpage; traversing the dom tree according to the current focus when a direction key pressing instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node; and if the phases are the same, moving the current focus to the target dom tree node. When the method and the device detect that the user presses the direction key, the potential focus to be switched can be found through the number, so that the secondary calculation process is saved, and the method and the device are more favorable for browsing the webpage in a direction key mode.

Description

Method and system for realizing focus control of browser
Technical Field
The invention relates to the technical field of browser focus control, in particular to a browser focus control implementation method and system.
Background
With the rapid development of internet technology, more and more devices with internet access function are available. Such as a cell phone, computer, pad, set-top box, watch, handheld device, etc. When browsing web pages in a traditional internet access way, a mouse or a touch screen and the like can be used for directly selecting a target from a plurality of focus elements in the web pages. Browsing web pages is not very convenient for devices that are not mouse and touch-based. The prior art does not have friendly support for browsing web pages by using direction keys to control the focus mode.
At present, a direction key is pressed in equipment in a non-mouse and touch mode, a browser traverses focuses in a DOM tree (Document Object Model) again, after an initial focus is given, a DOM tree node closest to the initial focus is recalculated and selected as a next focus according to an inherent algorithm, and the focus is moved according to the method, so that the moving efficiency is low, misoperation is easy to occur, and debugging of developers is not convenient.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a system for implementing browser focus control, aiming at solving the problems of low efficiency of controlling focus movement in browsing a webpage by a device in a non-mouse and touch manner, easy misoperation and inconvenient debugging by developers in the prior art.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a browser focus control implementation method comprises the following steps:
when the webpage is loaded, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage;
numbering the initial focus and all visible dom tree nodes in the webpage in an ascending order, and sequentially acquiring the numbering information of the initial focus and adjacent nodes of all visible dom tree nodes in the webpage;
traversing the dom tree according to the current focus when a direction key pressing instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
and if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node, moving the current focus to the target dom tree node.
The browser focus control implementation method comprises the following steps of selecting a visible dom tree node as an initial focus when the webpage is loaded, and traversing all visible dom tree nodes in the webpage:
when the webpage loading is finished, selecting a visible dom tree node as an initial focus;
and traversing all visible node nodes of the dom tree in the webpage, and obtaining the position information and the size information of each node of the dom tree.
The browser focus control implementation method includes the steps of setting numbers of an initial focus and all visible dom tree nodes in a webpage in an ascending order, and acquiring adjacent node number information of the initial focus and all visible dom tree nodes in the webpage in the ascending order:
setting numbers for all visible dom tree nodes in an initial focus and a webpage, and setting adjacent node number information comprising an upper adjacent node number, a lower adjacent node number, a left adjacent node number and a right adjacent node number;
assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
sequentially calculating and obtaining the initial focus and adjacent node number information of all visible dom tree nodes in the webpage; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
The browser focus control implementation method includes the following steps that when a direction key pressing instruction is received, a dom tree is traversed according to a current focus, and whether a number value included in adjacent node number information corresponding to the current focus is the same as a number of a target dom tree node is inquired:
when a direction key pressing instruction is received, traversing the dom tree by taking the current focus as a starting point;
and inquiring whether the number value of the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node of the current focus is the same as the number of the target dom tree node.
The browser focus control implementation method comprises the following steps of traversing a dom tree according to a current focus when a direction key press instruction is received, and inquiring whether a number value included in adjacent node number information corresponding to the current focus is the same as the number of a target dom tree node or not:
and when the page is detected to be updated, returning to the step of executing the completion of the webpage loading, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage.
A browser focus control implementation system, comprising:
the initialization and traversal module is used for selecting a visible dom tree node as an initial focus when the webpage loading is finished, and traversing all visible dom tree nodes in the webpage;
the numbering setting module is used for setting numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order and sequentially acquiring the number information of adjacent nodes of the initial focus and all visible dom tree nodes in the webpage;
the judging module is used for traversing the dom tree according to the current focus when a direction key press instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
and the focus moving control module is used for moving the current focus to the target dom tree node if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node.
The system for realizing browser focus control comprises an initialization and traversal module, wherein the initialization and traversal module specifically comprises:
the initial focus selecting unit is used for selecting a visible dom tree node as an initial focus when the webpage loading is finished;
and the dom tree node traversing unit is used for traversing all visible dom tree nodes in the webpage and obtaining the position information and the size information of each dom tree node.
The browser focus control implementation system, wherein the number setting module specifically includes:
the parameter definition unit is used for setting numbers for all visible dom tree nodes in the initial focus and the webpage, and setting adjacent node number information comprising an upward adjacent node number, a downward adjacent node number, a leftward adjacent node number and a rightward adjacent node number;
the number assignment unit is used for assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
the adjacent node number information acquisition unit is used for calculating and acquiring the initial focus and the adjacent node number information of all visible dom tree nodes in the webpage in sequence; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
The system for realizing the focus control of the browser comprises a judging module, a focus control module and a control module, wherein the judging module specifically comprises:
the direction key detection unit is used for traversing the dom tree by taking the current focus as a starting point when receiving a direction key pressing instruction;
and the inquiring unit is used for inquiring whether the number value of the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node of the current focus is the same as the number of the target dom tree node.
The browser focus control implementation system further comprises:
and the updating module is used for returning to the starting initialization and traversal module when the page is detected to be updated.
Has the advantages that: according to the browser focus control implementation method and the browser focus control implementation system, when a user browses a webpage by using equipment in a non-mouse and touch mode and detects that the user presses a direction key, the user does not need to traverse and calculate the layout size, the optimal distance and the like of each dom tree every time, and a potential focus to be switched can be found by numbering, so that the process of secondary calculation is saved, the webpage can be browsed by using the direction key mode more conveniently, and debugging of developers is facilitated.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a method for implementing browser focus control in accordance with the present invention;
FIG. 2 is a schematic diagram of a webpage including the numbers of 7 dom tree nodes and the number information of adjacent nodes in the present invention;
FIG. 3 is a block diagram of a system for implementing focus control of a browser according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Please refer to fig. 1, which is a flowchart illustrating a method for implementing browser focus control according to a preferred embodiment of the present invention. As shown in fig. 1, the browser focus control implementation method includes the following steps:
s100, when the webpage is loaded, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage;
s200, setting numbers of the initial focus and all visible dom tree nodes in the webpage according to an ascending order, and sequentially acquiring the number information of adjacent nodes of the initial focus and all visible dom tree nodes in the webpage;
step S300, when a direction key pressing instruction is received, traversing the dom tree according to the current focus, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
and S400, if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node, moving the current focus to the target dom tree node.
In the embodiment of the invention, when the webpage is loaded, a visible node of the dom tree is selected as an initial focus, then the node of the dom tree is traversed, a mark is made for each node of the dom tree according to the position of a rectangular frame of the visible node of the dom tree, and then the focus can be moved according to the mark when a direction key is pressed each time. And, there is dynamic refreshing update in the webpage, and the mark of each dom tree node is refreshed at the same time.
Therefore, when the user presses the direction key, the user does not need to traverse and calculate the layout size, the optimal distance and the like of each dom tree every time. The potential focus to be switched can be found through numbering, so that the process of secondary calculation is saved
Preferably, as a specific embodiment of the method for implementing browser focus control according to the present invention, the step S100 specifically includes:
s101, when the webpage loading is finished, selecting a visible dom tree node as an initial focus;
step S102, traversing all visible node nodes of the dom tree in the webpage, and obtaining position information and size information of each node of the dom tree.
Preferably, as a specific embodiment of the method for implementing browser focus control according to the present invention, the step S200 specifically includes:
step S201, setting numbers for all visible dom tree nodes in an initial focus and a webpage, and setting adjacent node number information including an upward adjacent node number, a downward adjacent node number, a leftward adjacent node number and a rightward adjacent node number;
step S202, assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
step S203, sequentially calculating and acquiring the initial focus and adjacent node number information of all visible dom tree nodes in the webpage; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
Please refer to fig. 2, which is a schematic diagram of a webpage including numbers of 7 dom tree nodes and number information of neighboring nodes. In step S201, each node of the dom tree in the dom tree is given a number index and four flags, respectively indexUp, indexLeft, indexRight, where indexUp denotes an upward neighboring node number, indexLeft denotes a downward neighboring node number, indexLeft denotes a leftward neighboring node number, and indexRight denotes a rightward neighboring node number.
Thereafter, in step S202, the number of the initial focus is set to 0, i.e., to be denoted as index (0), the other dom tree nodes are numbered sequentially, and the number of each dom tree node cannot be the same. Optimally, the nodes of the dom tree, except for the initial focus, are numbered in ascending order. In fig. 2, the other 6 node nodes of the dom tree except for index (0) are denoted as index (1), index (2), index (3), index (4), index (5), and index (6), respectively.
In step S203, the node of the dom tree of the initial focus is used as the starting point. The nodes above, below, left and right of the initial focus are calculated, and the corresponding node numbers of the dom tree are recorded in indexUp, indexDown, indexLeft and indexRight. If the upper side, the lower side, the left side or the right side of the node of the dom tree has no next node, changing the corresponding value to-1; for example, index (0) is already the node located at the top position in the web page layout, and the indexUp value of this node of the dom tree is changed to-1. In this way, in step S203, indexUp, indexLeft, indexRight of all the dom tree nodes are recorded.
Preferably, as a specific embodiment of the method for implementing browser focus control according to the present invention, the step S300 specifically includes:
step S301, when a direction key instruction is received, traversing a dom tree by taking a current focus as a starting point;
step S302, inquiring whether the number value of the upward adjacent node number, the downward adjacent node number, the leftward adjacent node number or the rightward adjacent node number of the current focus is the same as the number of the target dom tree node.
When the user presses the direction key, the dom tree is traversed once, and if the values recorded in indexUp, indexun, indexLeft and indexRight are the same as the number of the node of the dom tree, the node is the focus to be switched. After finding the candidate focus, the focus is moved to the candidate focus.
For example, if the current focus is the initial focus index (0), the corresponding neighboring node number information of index (0) is denoted as indexUp (-1), indexDown (2), indexLeft (-1), indexRight (1). When the user presses the left direction key, the current focus does not move; when the user presses the upward direction key, the current focus does not move; when the user presses a down direction key, the current focus is moved to index (2); when the user presses the right direction key, the current focus is moved to index (1).
Preferably, as a specific embodiment of the method for implementing browser focus control according to the present invention, after the step S400, the method further includes:
step S500, when the page is detected to be updated, returning to the step of executing the completion of webpage loading, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage.
When the page is dynamically updated or partially refreshed, numbers of all the nodes of the dom tree need to be given again, and the values of indexUp, indexDown, indexLeft and indexRight of all the nodes of the dom tree are calculated again.
Therefore, the invention provides a mode for quickly switching focuses, all the node of the dom tree are marked, the nodes of the upper part, the lower part, the left part and the right part of each node of the dom tree are recorded, and only the number needs to be found when the focuses are switched.
Based on the method embodiment, the invention also provides a system for realizing the focus control of the browser. As shown in fig. 3, the browser focus control implementation system includes:
the initialization and traversal module 100 is configured to select a visible dom tree node as an initial focus when the webpage loading is completed, and traverse all visible dom tree nodes in the webpage;
the numbering setting module 200 is configured to set numbers of the initial focus and all visible nodes of the dom tree in the webpage in an ascending order, and sequentially obtain numbering information of adjacent nodes of the initial focus and all visible nodes of the dom tree in the webpage;
the judging module 300 is configured to traverse the dom tree according to the current focus when receiving the direction key instruction, and query whether a number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
and a focus moving control module 400, configured to move the current focus to the target dom tree node if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node.
Preferably, in the system for implementing browser focus control, the initialization and traversal module 100 specifically includes:
the initial focus selecting unit is used for selecting a visible dom tree node as an initial focus when the webpage loading is finished;
and the dom tree node traversing unit is used for traversing all visible dom tree nodes in the webpage and obtaining the position information and the size information of each dom tree node.
Preferably, in the system for implementing browser focus control, the number setting module 200 specifically includes:
the parameter definition unit is used for setting numbers for all visible dom tree nodes in the initial focus and the webpage, and setting adjacent node number information comprising an upward adjacent node number, a downward adjacent node number, a leftward adjacent node number and a rightward adjacent node number;
the number assignment unit is used for assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
the adjacent node number information acquisition unit is used for calculating and acquiring the initial focus and the adjacent node number information of all visible dom tree nodes in the webpage in sequence; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
Preferably, in the system for implementing focus control of a browser, the determining module 300 specifically includes:
the direction key detection unit is used for traversing the dom tree by taking the current focus as a starting point when receiving a direction key pressing instruction;
and the inquiring unit is used for inquiring whether the number value of the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node of the current focus is the same as the number of the target dom tree node.
Preferably, in the system for implementing browser focus control, the system further includes:
and the updating module is used for returning to the starting initialization and traversal module when the page is detected to be updated.
In summary, the method and system for implementing browser focus control according to the present invention includes: when the webpage is loaded, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage; numbering the initial focus and all visible dom tree nodes in the webpage in an ascending order, and sequentially acquiring the numbering information of the initial focus and adjacent nodes of all visible dom tree nodes in the webpage; traversing the dom tree according to the current focus when a direction key pressing instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node; and if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node, moving the current focus to the target dom tree node. When a user browses a webpage by using equipment in a non-mouse and touch mode and detects that the user presses a direction key, the user does not need to traverse and calculate the layout size, the optimal distance and the like of each dom tree every time, and a potential focus to be switched can be found by numbering, so that the process of secondary calculation is saved, the webpage can be browsed by using the direction key mode more conveniently, and the debugging of developers is facilitated.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (8)

1. A browser focus control implementation method is characterized by comprising the following steps:
when the webpage is loaded, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage;
numbering the initial focus and all visible dom tree nodes in the webpage in an ascending order, and sequentially acquiring the numbering information of the initial focus and adjacent nodes of all visible dom tree nodes in the webpage;
traversing the dom tree according to the current focus when a direction key pressing instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node, moving the current focus to the target dom tree node;
the step of traversing the dom tree according to the current focus when the direction key press instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node specifically comprises the following steps:
when a direction key pressing instruction is received, traversing the dom tree by taking the current focus as a starting point;
and inquiring whether the number value of the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node of the current focus is the same as the number of the target dom tree node.
2. The method for implementing browser focus control according to claim 1, wherein the step of selecting a visible dom tree node as an initial focus when the web page is completely loaded and traversing all visible dom tree nodes in the web page specifically comprises:
when the webpage loading is finished, selecting a visible dom tree node as an initial focus;
and traversing all visible node nodes of the dom tree in the webpage, and obtaining the position information and the size information of each node of the dom tree.
3. The method for implementing browser focus control according to claim 1, wherein the step of numbering the initial focus and all visible nodes of the dom tree in the web page in an ascending order and acquiring the numbering information of the initial focus and all visible nodes of the dom tree in the web page in an ascending order specifically comprises:
setting numbers for all visible dom tree nodes in an initial focus and a webpage, and setting adjacent node number information comprising an upper adjacent node number, a lower adjacent node number, a left adjacent node number and a right adjacent node number;
assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
sequentially calculating and obtaining the initial focus and adjacent node number information of all visible dom tree nodes in the webpage; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
4. The browser focus control implementation method according to any one of claims 1 to 3, wherein the step of traversing the dom tree according to the current focus and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node when the direction key pressing instruction is received further includes:
and when the page is detected to be updated, returning to the step of executing the completion of the webpage loading, selecting a visible dom tree node as an initial focus, and traversing all visible dom tree nodes in the webpage.
5. A browser focus control implementation system, comprising:
the initialization and traversal module is used for selecting a visible dom tree node as an initial focus when the webpage loading is finished, and traversing all visible dom tree nodes in the webpage;
the numbering setting module is used for setting numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order and sequentially acquiring the number information of adjacent nodes of the initial focus and all visible dom tree nodes in the webpage;
the judging module is used for traversing the dom tree according to the current focus when a direction key press instruction is received, and inquiring whether the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
the focus moving control module is used for moving the current focus to the target dom tree node if the number value included in the number information of the adjacent node corresponding to the current focus is the same as the number of the target dom tree node;
the judging module specifically comprises:
the direction key detection unit is used for traversing the dom tree by taking the current focus as a starting point when receiving a direction key pressing instruction;
and the inquiring unit is used for inquiring whether the number value of the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node of the current focus is the same as the number of the target dom tree node.
6. The system for implementing browser focus control according to claim 5, wherein the initialization and traversal module specifically includes:
the initial focus selecting unit is used for selecting a visible dom tree node as an initial focus when the webpage loading is finished;
and the dom tree node traversing unit is used for traversing all visible dom tree nodes in the webpage and obtaining the position information and the size information of each dom tree node.
7. The system for implementing browser focus control according to claim 5, wherein the number setting module specifically includes:
the parameter definition unit is used for setting numbers for all visible dom tree nodes in the initial focus and the webpage, and setting adjacent node number information comprising an upward adjacent node number, a downward adjacent node number, a leftward adjacent node number and a rightward adjacent node number;
the number assignment unit is used for assigning numbers of the initial focus and all visible dom tree nodes in the webpage in an ascending order, wherein the number of the initial focus is set to be 0, the numbers of all visible dom tree nodes in the webpage are set in an ascending order from 1, and the numbers are integers;
the adjacent node number information acquisition unit is used for calculating and acquiring the initial focus and the adjacent node number information of all visible dom tree nodes in the webpage in sequence; and if the initial focus and the left side, the right side, the upper side or the lower side of all visible dom tree nodes in the webpage have nodes without adjacent nodes, correspondingly setting the number of the upward adjacent node, the number of the downward adjacent node, the number of the leftward adjacent node or the number of the rightward adjacent node as-1.
8. The browser focus control implementation system of any one of claims 5 to 7, further comprising: and the updating module is used for returning to the starting initialization and traversal module when the page is detected to be updated.
CN201710031865.8A 2017-01-17 2017-01-17 Method and system for realizing focus control of browser Active CN106708371B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710031865.8A CN106708371B (en) 2017-01-17 2017-01-17 Method and system for realizing focus control of browser
PCT/CN2017/110060 WO2018133504A1 (en) 2017-01-17 2017-11-09 Browser focus control implementation method and implementation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710031865.8A CN106708371B (en) 2017-01-17 2017-01-17 Method and system for realizing focus control of browser

Publications (2)

Publication Number Publication Date
CN106708371A CN106708371A (en) 2017-05-24
CN106708371B true CN106708371B (en) 2020-04-07

Family

ID=58907757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710031865.8A Active CN106708371B (en) 2017-01-17 2017-01-17 Method and system for realizing focus control of browser

Country Status (2)

Country Link
CN (1) CN106708371B (en)
WO (1) WO2018133504A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708371B (en) * 2017-01-17 2020-04-07 深圳创维数字技术有限公司 Method and system for realizing focus control of browser
CN109309874B (en) * 2018-08-31 2021-05-11 海信视像科技股份有限公司 Focus updating method and device
CN112929717B (en) * 2019-12-06 2022-07-29 青岛海信传媒网络技术有限公司 Focus management method and display device
CN112565898B (en) * 2020-11-27 2023-04-07 福州智象信息技术有限公司 Method and system for moving focus based on smart television operating system
CN113378086B (en) * 2021-06-07 2022-07-26 聚好看科技股份有限公司 Method and device for controlling page movement based on focus position movement

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007096844A (en) * 2005-09-29 2007-04-12 Nec Personal Products Co Ltd Document displaying method and document displaying device
CN102402601A (en) * 2011-11-18 2012-04-04 四川长虹电器股份有限公司 Focus navigation method based on embedded full-functional browser
CN102467383A (en) * 2010-11-17 2012-05-23 康佳集团股份有限公司 Method for implementing tab windows in graphical interface of embedded system
CN102609521A (en) * 2012-02-10 2012-07-25 深圳创维数字技术股份有限公司 Webpage focus element switching method and digital television receiving terminal
CN103473055A (en) * 2013-09-06 2013-12-25 乐视致新电子科技(天津)有限公司 Focus movement control method and device
CN103713834A (en) * 2013-12-30 2014-04-09 深圳Tcl新技术有限公司 Focus positioning method and device
CN104778239A (en) * 2015-04-03 2015-07-15 中国科学院声学研究所 Focus query method for embedded browser

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708371B (en) * 2017-01-17 2020-04-07 深圳创维数字技术有限公司 Method and system for realizing focus control of browser

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007096844A (en) * 2005-09-29 2007-04-12 Nec Personal Products Co Ltd Document displaying method and document displaying device
CN102467383A (en) * 2010-11-17 2012-05-23 康佳集团股份有限公司 Method for implementing tab windows in graphical interface of embedded system
CN102402601A (en) * 2011-11-18 2012-04-04 四川长虹电器股份有限公司 Focus navigation method based on embedded full-functional browser
CN102609521A (en) * 2012-02-10 2012-07-25 深圳创维数字技术股份有限公司 Webpage focus element switching method and digital television receiving terminal
CN103473055A (en) * 2013-09-06 2013-12-25 乐视致新电子科技(天津)有限公司 Focus movement control method and device
CN103713834A (en) * 2013-12-30 2014-04-09 深圳Tcl新技术有限公司 Focus positioning method and device
CN104778239A (en) * 2015-04-03 2015-07-15 中国科学院声学研究所 Focus query method for embedded browser

Also Published As

Publication number Publication date
WO2018133504A1 (en) 2018-07-26
CN106708371A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106708371B (en) Method and system for realizing focus control of browser
US20140053143A1 (en) Context-specific optimized code
RU2614567C2 (en) Method and mobile terminal device for performing operations with images
CN102609136B (en) Dynamic correcting method for reference value data, device and touch gesture identification method
US9916291B2 (en) Method, apparatus, and terminal device for displaying multiple input boxes in a web page where display space is limited
CN103648055A (en) Screen adaptive method of intelligent TV browser, device thereof and intelligent TV
CN104778239B (en) A kind of built-in browser focus querying method
WO2014153986A1 (en) Method, apparatus, and terminal device for displaying multiple input boxes in a web page
CN104794116A (en) Layout method and device for elements in page
JP2015167031A (en) Method, apparatus and computer program for adjusting layout size of hyperlink (adjusting layout size of hyperlink)
TW201516836A (en) Electronic device with dynamic map-type interface, method for controlling the dynamic map-type interface and system thereof
CN111273826A (en) Desktop icon management method, device, equipment and storage medium
CN105307048B (en) WebKit kernel-based focus query method for smart television
CN111698491B (en) Multi-projection image display method and device, electronic equipment and storage medium
CN106998489B (en) A kind of focus is crossed the border searching method and device
CN104777999A (en) Touch position display method and touch position display system
JP5307294B2 (en) Operation support computer program, operation support computer system
CN105930090A (en) Method and system for transmitting coordinate data of touch screens on basis of mobile terminals
CN107369192B (en) Connection relation processing method and device
JP5905550B1 (en) Information processing apparatus, information display program, and information display method
CN105227980B (en) A kind of input method of TV browser, apparatus and system
CN115202553A (en) Control method and device for whiteboard application and electronic equipment
CN112529984A (en) Method and device for drawing polygon, electronic equipment and storage medium
KR102075357B1 (en) Method for searching based pixel
CN115563932B (en) Table paging method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant