CN113051495A - Web page focus navigation method and device - Google Patents
Web page focus navigation method and device Download PDFInfo
- Publication number
- CN113051495A CN113051495A CN201911373711.2A CN201911373711A CN113051495A CN 113051495 A CN113051495 A CN 113051495A CN 201911373711 A CN201911373711 A CN 201911373711A CN 113051495 A CN113051495 A CN 113051495A
- Authority
- CN
- China
- Prior art keywords
- focus
- web page
- control
- focus control
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/954—Navigation, e.g. using categorised browsing
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a method and a device for navigating a web page focus, wherein the method comprises the following steps: when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser that the focus switching event is triggered; the kernel determines a new focus control after corresponding switching according to the focus switching event and the position of the current focus control and informs the web page; acquiring focus frame attribute information from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page; and the web page draws a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information. By applying the technical scheme disclosed by the application, the development complexity and the maintenance cost of the web page can be effectively reduced.
Description
Technical Field
The application relates to the technical field of computer application, in particular to a method and a device for navigating a web page focus.
Background
Currently, when a web page shows that a currently selected focus area is switched and moved, the following states exist: a user switches the focus frame up, down, left and right through operation (keys, a mouse, touch control and the like); and the user enlarges and reduces the page, and performs focus switching after synchronously refreshing the focus frame.
For the above scenario of focus switching and refreshing, the existing web page focus navigation scheme adopted by the browser based on the Blink kernel is realized by drawing the web page at the front end. Specifically, the web page at the front end displays and switches the corresponding focus on the web page according to an event triggered by user operation (including operations such as key pressing, mouse touching, and the like) and according to a preset logic processing method corresponding to the event.
The inventor finds that the existing web page focus navigation scheme has the problem of high development and maintenance cost in the process of implementing the invention, and the specific reasons are analyzed as follows:
according to the web page focus navigation scheme, the web page at the front end needs to display and switch the focus on the current web page by executing the logic processing method corresponding to the operation event triggered by the current user, so that each web page needs to have a corresponding event processing code, and research and development personnel need to perform corresponding event processing design respectively aiming at each web page in the web page development process.
In addition, the event processing logic in the web page needs to distinguish the user operation types, such as key operation, mouse operation or touch operation, and provide corresponding event processing logic for different operation functions under each operation type, such as moving up or moving down, respectively. Thus, event processing codes corresponding to various operation functions for each operation type are required. Even for the same operation function under different operation types, such as a mouse operation and a touch operation which also cause focus to move upwards, because the same operation function belongs to different operation types, event processing logics need to be designed respectively, so that the event processing logics which need to be designed during web page development are complex, the code development amount is large, and further the development and maintenance costs of the web page are high.
Disclosure of Invention
In view of this, the main objective of the present invention is to provide a method and an apparatus for web focus navigation, which can effectively reduce the development complexity and the maintenance cost of a web page.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
a web page focus navigation method, comprising:
when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser that the focus switching event is triggered;
the kernel determines a new focus control after corresponding switching according to the focus switching event and the position of the current focus control and informs the web page; acquiring focus frame attribute information from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page;
and the web page draws a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information.
Preferably, the determining the new focus control after the corresponding switching includes:
traversing each control in the web page, and judging the alignment relation between the control and the current focus control;
if there is a control in the web page that satisfies: if the focus control is completely aligned with the current focus control, taking the control as the new focus control;
if there is only one control in the web page that satisfies: if the current focus control is aligned with the current focus control in a crossed manner, the control is taken as the new focus control;
and if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
Preferably, the kernel is a Blink kernel.
A web page focus navigation apparatus comprising: a processor to:
when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser of the triggered focus switching event by using the web page;
determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control by using the kernel, and informing the new focus control to the web page; acquiring the attribute information of a focus frame of the current page from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page;
and drawing a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information by using the web page.
Preferably, the processor is specifically configured to: determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control, including:
traversing each control in the web page, and judging the alignment relation between the control and the current focus control;
if there is a control in the web page that satisfies: if the focus control is completely aligned with the current focus control, taking the control as the new focus control;
if there is only one control in the web page that satisfies: if the current focus control is aligned with the current focus control in a crossed manner, the control is taken as the new focus control;
and if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
Preferably, the kernel is a Blink kernel.
The present application also discloses a non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the web page focus navigation method as previously described.
The application also discloses an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
According to the technical scheme, when the web page of the browser detects that the focus switching event is triggered, the web page directly triggers the kernel to perform corresponding focus positioning and drawing processing, so that the switching function of a new focus aiming at various focus switching events can be avoided when the web page is designed, and the research and development complexity and the maintenance cost of the web page can be effectively reduced.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a control alignment relationship according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an example of a focused display of a web page according to an embodiment of the present invention;
FIG. 4 is an exemplary diagram of focus movement in the exemplary web page of FIG. 3.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic flow diagram of a method according to an embodiment of the present invention, and as shown in fig. 1, the method for navigating a web page focus implemented by the embodiment mainly includes the following steps:
In this step, different from the existing scheme, when the web page of the browser detects that the focus switching event is triggered (for example, the user moves the focus through a key or mouse operation), the focus switching event needs to be triggered and notified to the kernel of the browser, so that the kernel performs corresponding processing on the focus updates caused by the focus switching event, instead of performing the focus update processing by the web page of the browser, so that the above functions are not required to be implemented when the web page is designed, and thus the design complexity and cost of the web page can be effectively reduced.
Preferably, the browser may be a browser with a kernel of Blink kernel, such as, but not limited to, chrome, etc.
In this step, after receiving the notification that the focus switching event is triggered, the browser kernel processes the focus update caused by the focus switching event, unlike the web page processing in the existing scheme, without distinguishing whether the mode of triggering the focus switching event is a key operation, a mouse operation, a touch operation, or the like, the browser kernel determines a new focus control after corresponding switching according to the focus switching event directly, generates focus frame drawing information, and sends the determined new focus control and focus frame drawing information to the web page, which only needs to perform focus frame rendering at the position of the new focus control based on the focus frame drawing information, thereby reducing the development complexity and maintenance cost of the web page.
In this step, a specific method for generating corresponding focus frame drawing information according to the focus frame attribute information (such as the color, width, and other attributes of the focus frame) set in the web page is known by those skilled in the art, and is not described herein again.
Preferably, the following method may be adopted to determine the new focus control after the corresponding switching:
and step x1, traversing each control in the web page, and judging the alignment relation between the control and the current focus control.
In this step, the alignment relationship between each control in the web page and the current focus control is determined, so that in the subsequent step, a new focus control is determined according to the alignment relationship between each control and the current focus control.
In practical applications, the kernel of the browser may obtain the current focus control from the web page, and the specific method is known by those skilled in the art and is not described herein again.
Here, the alignment relationship (including three types, full alignment, cross alignment and full misalignment) between each control in the page and the current focus control can be determined by using the existing method.
Fig. 2 shows a schematic diagram of each alignment relationship, wherein diagram (a) is a schematic diagram of complete alignment: the rectangles are completely vertically or horizontally intersected; FIG. (b) is a schematic diagram of the full alignment of the crossovers: there is a partial intersection between rectangles in the vertical or horizontal direction; FIG. (c) is a schematic view of complete misalignment: at this time, there is no aligned element between the two.
Step x2, if there is a control in the web page that satisfies: and if the current focus control is completely aligned with the current focus control, taking the current focus control as the new focus control.
If there is only one control in the web page that satisfies: and if the current focus control is aligned with the current focus control in a crossed mode, taking the current focus control as the new focus control.
And if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
In this step, the accuracy of the display position of the focus frame can be ensured by determining the new focus control in a manner of highest priority of the complete alignment relation, priority of the cross alignment relation and lowest priority closest to the current focus control.
And 103, drawing a corresponding focus frame at the new focus control of the web page by the web page according to the focus frame drawing information.
In this step, after the web page receives the focus frame drawing information, the corresponding focus frame can be drawn at the new focus control of the page, so that the new focus frame can be presented in the page.
According to the embodiment, the code design amount of the web page can be effectively reduced, the design complexity of the web page is reduced, and the implementation cost is reduced. This effect is further explained below using a web page as an example:
for a web page with the following page contents, the effect shown in fig. 3 is presented after the page loading is performed, and the focus is located at the number 1, and when the operation key or mouse is operated, the focus is moved to a new position (i.e. the number 2). Therefore, the code complexity of the web page can be greatly reduced by adopting the method and the device.
Corresponding to the above method embodiment, the present application further provides a web page focus navigation apparatus, including: a processor to:
when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser of the triggered focus switching event by using the web page;
determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control by using the kernel, and informing the new focus control to the web page; acquiring the attribute information of a focus frame of the current page from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page;
and drawing a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information by using the web page.
Preferably, the processor is specifically configured to: determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control, including:
traversing each control in the web page, and judging the alignment relation between the control and the current focus control;
if there is a control in the web page that satisfies: if the focus control is completely aligned with the current focus control, taking the control as the new focus control;
if there is only one control in the web page that satisfies: if the current focus control is aligned with the current focus control in a crossed manner, the control is taken as the new focus control;
and if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
Preferably, the kernel is a Blink kernel.
Further, the present application provides a non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the web page focus navigation method as described above.
Further, the present application provides an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (8)
1. A method for navigating a focus of a web page, comprising:
when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser that the focus switching event is triggered;
the kernel determines a new focus control after corresponding switching according to the focus switching event and the position of the current focus control and informs the web page; acquiring focus frame attribute information from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page;
and the web page draws a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information.
2. The method of claim 1, wherein: the determining the corresponding switched new focus control comprises:
traversing each control in the web page, and judging the alignment relation between the control and the current focus control;
if there is a control in the web page that satisfies: if the focus control is completely aligned with the current focus control, taking the control as the new focus control;
if there is only one control in the web page that satisfies: if the current focus control is aligned with the current focus control in a crossed manner, the control is taken as the new focus control;
and if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
3. The method of claim 1, wherein: the kernel is a Blink kernel.
4. A web page focus navigation apparatus, comprising: a processor to:
when a web page of a browser detects that a focus switching event is triggered, informing a kernel of the browser of the triggered focus switching event by using the web page;
determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control by using the kernel, and informing the new focus control to the web page; acquiring the attribute information of a focus frame of the current page from the web page; generating corresponding focus frame drawing information according to the focus frame attribute information, and sending the corresponding focus frame drawing information to the web page;
and drawing a corresponding focus frame at the new focus control of the web page according to the focus frame drawing information by using the web page.
5. The apparatus of claim 4, wherein: the processor is specifically configured to: determining a new focus control after corresponding switching according to the focus switching event and the position of the current focus control, including:
traversing each control in the web page, and judging the alignment relation between the control and the current focus control;
if there is a control in the web page that satisfies: if the focus control is completely aligned with the current focus control, taking the control as the new focus control;
if there is only one control in the web page that satisfies: if the current focus control is aligned with the current focus control in a crossed manner, the control is taken as the new focus control;
and if all the controls in the web page are completely not aligned with the current focus control, taking the control closest to the current focus control as the new focus control.
6. The apparatus of claim 5, wherein: the kernel is a Blink kernel.
7. A non-transitory computer readable storage medium storing instructions which, when executed by a processor, cause the processor to perform the steps of the web page focus navigation method of any of claims 1 to 3.
8. An electronic device comprising the non-volatile computer-readable storage medium of claim 7, and the processor having access to the non-volatile computer-readable storage medium.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911373711.2A CN113051495B (en) | 2019-12-27 | 2019-12-27 | Web page focus navigation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911373711.2A CN113051495B (en) | 2019-12-27 | 2019-12-27 | Web page focus navigation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113051495A true CN113051495A (en) | 2021-06-29 |
CN113051495B CN113051495B (en) | 2023-10-20 |
Family
ID=76506273
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911373711.2A Active CN113051495B (en) | 2019-12-27 | 2019-12-27 | Web page focus navigation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113051495B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114153536A (en) * | 2021-11-12 | 2022-03-08 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Web page focus control method and system compatible with physical keys of touch screen |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110187739A1 (en) * | 2010-02-01 | 2011-08-04 | Canon Kabushiki Kaisha | Display control apparatus, display control method, and non-transitory computer readable storage medium |
CN102402601A (en) * | 2011-11-18 | 2012-04-04 | 四川长虹电器股份有限公司 | Focus navigation method based on embedded full-functional browser |
CN103713834A (en) * | 2013-12-30 | 2014-04-09 | 深圳Tcl新技术有限公司 | Focus positioning method and device |
CN103916710A (en) * | 2014-03-31 | 2014-07-09 | 优视科技有限公司 | Focal point switching method and system |
CN104854559A (en) * | 2014-10-16 | 2015-08-19 | 深圳市融资城网络服务中心有限公司 | Internet page unit aligning method and apparatus |
CN105302408A (en) * | 2014-06-24 | 2016-02-03 | 腾讯科技(深圳)有限公司 | Method and apparatus for adjusting position of hover button and terminal |
CN105307048A (en) * | 2015-10-15 | 2016-02-03 | 中国科学院声学研究所 | WebKit kernel based focus query method of smart television |
CN106610827A (en) * | 2015-10-23 | 2017-05-03 | 中国科学院声学研究所 | Method for extending customer attributes of browser focal point shift and realizing focal point shift |
CN106951481A (en) * | 2013-09-24 | 2017-07-14 | 青岛海信电器股份有限公司 | Web browser navigation method, web browser navigation device and television set |
CN108874492A (en) * | 2018-06-15 | 2018-11-23 | 深圳市茁壮网络股份有限公司 | A kind of method and apparatus of focus frame positioning |
-
2019
- 2019-12-27 CN CN201911373711.2A patent/CN113051495B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110187739A1 (en) * | 2010-02-01 | 2011-08-04 | Canon Kabushiki Kaisha | Display control apparatus, display control method, and non-transitory computer readable storage medium |
CN102402601A (en) * | 2011-11-18 | 2012-04-04 | 四川长虹电器股份有限公司 | Focus navigation method based on embedded full-functional browser |
CN106951481A (en) * | 2013-09-24 | 2017-07-14 | 青岛海信电器股份有限公司 | Web browser navigation method, web browser navigation device and television set |
CN103713834A (en) * | 2013-12-30 | 2014-04-09 | 深圳Tcl新技术有限公司 | Focus positioning method and device |
CN103916710A (en) * | 2014-03-31 | 2014-07-09 | 优视科技有限公司 | Focal point switching method and system |
CN105302408A (en) * | 2014-06-24 | 2016-02-03 | 腾讯科技(深圳)有限公司 | Method and apparatus for adjusting position of hover button and terminal |
CN104854559A (en) * | 2014-10-16 | 2015-08-19 | 深圳市融资城网络服务中心有限公司 | Internet page unit aligning method and apparatus |
CN105307048A (en) * | 2015-10-15 | 2016-02-03 | 中国科学院声学研究所 | WebKit kernel based focus query method of smart television |
CN106610827A (en) * | 2015-10-23 | 2017-05-03 | 中国科学院声学研究所 | Method for extending customer attributes of browser focal point shift and realizing focal point shift |
CN108874492A (en) * | 2018-06-15 | 2018-11-23 | 深圳市茁壮网络股份有限公司 | A kind of method and apparatus of focus frame positioning |
Non-Patent Citations (2)
Title |
---|
WANG HAITAO等: "Research on automated web navigation and data integration rules for web information extraction", 《JOURNAL OF FRONTIERS OF COMPUTER SCIENCE AND TECHNOLOGY》, vol. 8, no. 9, pages 1049 - 1066 * |
刘秀秀等: "基于webkit内核焦点查询算法的研究与优化", 《计算机工程与设计》, vol. 37, no. 2, pages 450 - 453 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114153536A (en) * | 2021-11-12 | 2022-03-08 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Web page focus control method and system compatible with physical keys of touch screen |
CN114153536B (en) * | 2021-11-12 | 2024-04-09 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Web page focus control method and system compatible with physical keys of touch screen |
Also Published As
Publication number | Publication date |
---|---|
CN113051495B (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9232089B2 (en) | Display processing apparatus, control method, and computer program | |
US9557894B2 (en) | Display system, display apparatus, manipulation apparatus and function selection apparatus | |
JP6427559B2 (en) | Permanent synchronization system for handwriting input | |
CN101630226B (en) | Rapid positioning method and device of display content of electronic equipment | |
DE112013004437B4 (en) | Method of defining an enter key on a keyboard and method of interpreting keystrokes | |
US20130257738A1 (en) | Numerical control apparatus | |
US20140304625A1 (en) | Page returning | |
CN103389869A (en) | Method, device and apparatus for regulating touch input interface | |
JP2015114978A (en) | Display device and program | |
CN112099686A (en) | Icon display control method and device and electronic equipment | |
CN108459783A (en) | Control method, device and the equipment of dummy keyboard, readable medium | |
EP2824562B1 (en) | Method and apparatus to reduce display lag of soft keyboard presses | |
US20150205483A1 (en) | Object operation system, recording medium recorded with object operation control program, and object operation control method | |
CN113051495A (en) | Web page focus navigation method and device | |
JPH07152528A (en) | Screen scroll device/method | |
CN104285204B (en) | Show equipment, display control method and non-transitory computer-readable medium | |
EP2897037A1 (en) | Display apparatus and display control program | |
CN105511733A (en) | Method, system and electronic device for adjusting multitask arraying sequence through pressure touch control | |
US20160034101A1 (en) | Operation method of a touch screen and touch screen device | |
JPS61275990A (en) | Electronic equipment with handwritten pattern recognizing function | |
JP2014112336A (en) | Information processing device and program | |
CN107562260B (en) | A kind of method and device of touch control | |
US20150286400A1 (en) | Information processing apparatus, control method, and storage medium | |
CN106020691A (en) | Item selection method and mobile terminal | |
KR101257760B1 (en) | Method for inputting characters by drag |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |