CN105701165B - Browser model switching method and switching device - Google Patents

Browser model switching method and switching device Download PDF

Info

Publication number
CN105701165B
CN105701165B CN201511031277.1A CN201511031277A CN105701165B CN 105701165 B CN105701165 B CN 105701165B CN 201511031277 A CN201511031277 A CN 201511031277A CN 105701165 B CN105701165 B CN 105701165B
Authority
CN
China
Prior art keywords
color
switching
display node
background value
browser
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
CN201511031277.1A
Other languages
Chinese (zh)
Other versions
CN105701165A (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.)
Guangdong Mingchuang Software Technology Co ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201511031277.1A priority Critical patent/CN105701165B/en
Publication of CN105701165A publication Critical patent/CN105701165A/en
Application granted granted Critical
Publication of CN105701165B publication Critical patent/CN105701165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Abstract

The present invention provides a kind of browser model switching method comprising: reception pattern switching command, and the display node tree for obtaining current browse webpage is instructed according to pattern switching;To the element background value color of the display node on display node tree, switched over by the corresponding background color of preassigned pattern;Brightness linear adjustment is carried out to the element background value color of the display node after switching;And color Serial regulation is carried out to the element background value color of brightness linear display node adjusted.The present invention also provides a kind of browser model switching devices, browser model switching method of the invention and switching device realize the switching of browser model by the color and brightness adjustment of the element background value color of the display node of the display node tree of current browse webpage;And above-mentioned adjustment mode is compatible in the browser of different Chromium kernel versions.

Description

Browser model switching method and switching device
Technical field
The present invention relates to browser control fields, more particularly to a kind of browser model switching method and switching device.
Background technique
In recent years, with the high speed development of 3G/4G network, mobile Internet growth momentum is increasingly rapidly got up, currently Also increasingly pay attention to the optimization of user experience and the individual demand of user in mobile phone browser market.If browser is not for It is a kind of new function for the individual demand for improving user experience and meeting user with the browse mode switching under use environment Energy.Web page browsing is carried out as the lower Night of light intensity can be switched at night, it is higher that light intensity can be switched on daytime Day mode carry out web page browsing.
The browse mode of existing mobile phone browser is all based on the webkit kernel of apple, the side of browse mode switching Formula can not be directly applied on the browser of the Chromium kernel based on Google, therefore the browsing of existing Chromium kernel A kind of browser model switching mode of the device without compatible difference Chromium kernel version.
Summary of the invention
The embodiment of the present invention provides a kind of browser model switching method of compatible different Chromium kernel version And switching device;To solve the browsing that the browser of existing Chromium kernel cannot be compatible with different Chromium kernel versions The technical issues of device pattern switching.
The embodiment of the present invention provides a kind of browser model switching method comprising:
Reception pattern switching command, and the display node tree for obtaining current browse webpage is instructed according to the pattern switching, Wherein the pattern switching instruction is for switching to preassigned pattern for the browser model of corresponding terminal;
To the element background value color of the display node on the display node tree, by the corresponding background color of the preassigned pattern It switches over;
Brightness linear adjustment is carried out to the element background value color of the display node after switching;And
The element background value color of the display node adjusted to brightness linear carries out color Serial regulation.
In browser model switching method of the present invention, the display node adjusted to brightness linear Element background value color carry out color Serial regulation the step of after further include:
To the background colour of system control and system pop-up, switched over by the corresponding background color of the preassigned pattern.
It is described current clear according to pattern switching instruction acquisition in browser model switching method of the present invention Look at the page display node tree the step of include:
The Document Object Model tree for obtaining current browse webpage is instructed according to the pattern switching;And
According to the document dbject model book, the display node tree of the current browse webpage is obtained.
In browser model switching method of the present invention, the element back of the display node after described pair of switching Scenery carries out the step of brightness linear adjustment specifically:
Adjusted by gamma color range or primary display channels adjustment, to the element background value color of the display node after switching into The adjustment of row brightness linear.
In browser model switching method of the present invention, the system control includes but is not limited to radio box control And at least one of check box control;The system pop-up includes but is not limited in page warning window and password prompt window At least one.
The embodiment of the invention also includes a kind of browser model switching devices comprising:
It shows that node tree obtains module, is used for reception pattern switching command, and obtain and work as according to pattern switching instruction The display node tree of preceding browsing pages, wherein pattern switching instruction is pre- for switching to the browser model of corresponding terminal Mould-fixed;
First background colour switching module, for the element background value color to the display node on the display node tree, by institute The corresponding background color of preassigned pattern is stated to switch over;
Brightness linear adjusts module, carries out brightness linear tune for the element background value color to the display node after switching It is whole;And
Color Serial regulation module carries out color for the element background value color to the brightness linear display node adjusted Color Serial regulation.
In browser model switching device of the present invention, the browser model switching device further include:
Second background colour switching module, for the background colour to system control and system pop-up, by the preassigned pattern Corresponding background color switches over.
In browser model switching device of the present invention, the display node tree obtains module and includes:
Document Object Model tree acquiring unit, for instructing the file for obtaining current browse webpage according to the pattern switching Object scheme tree;And
Node tree acquiring unit is shown, for obtaining the current browse webpage according to the document dbject model book Show node tree.
In browser model switching device of the present invention, the brightness linear adjustment module is specifically used for passing through gal The adjustment of horse color range or primary display channels adjustment carry out brightness linear tune to the element background value color of the display node after switching It is whole.
In browser model switching device of the present invention, the system control includes but is not limited to radio box control And at least one of check box control;The system pop-up includes but is not limited in page warning window and password prompt window At least one.
Browser model switching method and switching device compared to the prior art, browser model switching side of the invention The color and brightness of method and switching device by the element background value color of the display node of the display node tree of current browse webpage Adjustment, realizes the switching of browser model;And the above-mentioned compatible browsing in different Chromium kernel versions of adjustment mode In device;The browser for solving existing Chromium kernel cannot be compatible with the browser model of different Chromium kernel versions The technical issues of switching.
Detailed description of the invention
Fig. 1 is the flow chart of the first preferred embodiment of browser model switching method of the invention;
Fig. 2 is the flow chart of the second preferred embodiment of browser model switching method of the invention;
Fig. 3 is the flow chart of the step S201 of the second preferred embodiment of browser model switching method of the invention;
Fig. 4 is the structural schematic diagram of the first preferred embodiment of browser model switching device of the invention;
Fig. 5 is the structural schematic diagram of the second preferred embodiment of browser model switching device of the invention;
Fig. 6 is that the display node tree of the second preferred embodiment of browser model switching device of the invention obtains module Structural schematic diagram.
Specific embodiment
Schema is please referred to, wherein identical component symbol represents identical component, the principle of the present invention is to implement one It is illustrated in computing environment appropriate.The following description be based on illustrated by the specific embodiment of the invention, should not be by It is considered as the limitation present invention other specific embodiments not detailed herein.
In the following description, specific embodiments of the present invention will refer to the operation as performed by one or multi-section computer The step of and symbol illustrate, unless otherwise stating clearly.Therefore, these steps and operation be will appreciate that, mentioned for several times wherein having It include by representing with the computer disposal list of the electronic signal of the data in a structuring pattern to be executed by computer Member is manipulated.At this manipulation transforms data or the position being maintained in the memory system of the computer, it can match again Set or in addition change in a manner familiar to those skilled in the art the running of the computer.The maintained data knot of the data Structure is the provider location of the memory, has the specific feature as defined in the data format.But the principle of the invention is with above-mentioned Text illustrates, is not represented as a kind of limitation, those skilled in the art will appreciate that plurality of step as described below and Operation also may be implemented in hardware.
Various electronic equipments can be used to be implemented for browser model switching device of the invention, the electronic equipment include but It is not limited to personal computer, server computer, hand-held or laptop devices, mobile device (such as mobile phone, a number Word assistant (PDA), media player etc.), multicomputer system, consumer electronic devices, minicomputer, mass computing Machine, distributed computing environment including above-mentioned arbitrary system or equipment, etc..But the electronic equipment is preferably intelligent mobile end End, to improve intelligent mobile terminal to the compatibility of the terminal browser of different Chromium kernel versions.
Fig. 1 is please referred to, Fig. 1 is the flow chart of the first preferred embodiment of browser model switching method of the invention.This Above-mentioned electronic equipment can be used to be implemented for the browser model switching method of preferred embodiment.The browser model switching side Method includes:
Step S101, reception pattern switching command, and the display section for obtaining current browse webpage is instructed according to pattern switching Point tree;
Step S102, to the element background value color of the display node on display node tree, by the corresponding background face of preassigned pattern Color switches over;
Step S103 carries out brightness linear adjustment to the element background value color of the display node after switching;
The element background value color of step S104, display node adjusted to brightness linear carry out color Serial regulation.
The following detailed description of the detailed process of each step of the browser model switching method of this preferred embodiment.
In step s101, browser model switching device reception pattern switching command, pattern switching instruction is used for will The browser model of corresponding terminal switches to preassigned pattern, as user's request by current browse webpage switch to Night or The instruction of page browsing is carried out under the preassigned patterns such as day mode.Subsequent browser model switching device refers to according to the pattern switching The display node tree (render tree) for obtaining current browse webpage is enabled, wherein display node tree is used to form current browse webpage and exists Display layout on screen.Then pass to step S102.
In step s 102, the display section of the display node tree obtained in browser model switching device obtaining step S101 The element background value color of point (render node) can obtain the display section by the RenderStyle attribute of display node here The element background value color, such as setBackgroundColor, setBorderColor background colour attribute etc. of point.Subsequent browser mould The corresponding background color of preassigned pattern that formula switching device is determined by step S101 cuts the element background value color of display node It changes.As preassigned pattern be Night when, the element background value color for showing node is switched to dead color by browser model switching device; As preassigned pattern be day mode when, the element background value color for showing node is switched to light tone by browser model switching device.With After go to step S103.
In step s 103, element background value of the browser model switching device to the display node after the switching of step S102 Color carries out brightness linear adjustment.It is bright after either carrying out darkening or the adjustment of the brightening isopleth of brightness to current browse webpage in this way Entire current browse webpage after spending Serial regulation is all not in luminance distortion, meets the page browsing habit of user.Then Go to step S104.
In step S104, browser model switching device display node adjusted to the brightness linear of step S103 Element background value color carries out color Serial regulation, i.e., so that the element background value color of display node meets color-grading requirement.Color line Property entire current browse webpage adjusted is all not in color distortion, and the page browsing of the user of same further satisfaction is wanted It asks.
The browser model handoff procedure of the browser model switching method of this preferred embodiment is completed in this way.
The display section that the browser model switching method of this preferred embodiment passes through the display node tree of current browse webpage The color and brightness adjustment of the element background value color of point, realize the switching of browser model;And above-mentioned adjustment mode is compatible In the browser of different Chromium kernel versions.
Referring to figure 2., Fig. 2 is the flow chart of the second preferred embodiment of browser model switching method of the invention.This Above-mentioned electronic equipment can be used to be implemented for the browser model switching method of preferred embodiment.The browser model switching side Method includes:
Step S201, reception pattern switching command, and the display section for obtaining current browse webpage is instructed according to pattern switching Point tree, wherein pattern switching instruction is for switching to preassigned pattern for the browser model of corresponding terminal;
Step S202, to the element background value color of the display node on display node tree, by the corresponding background face of preassigned pattern Color switches over;
Step S203, is adjusted by gamma color range or primary display channels adjust, and is carried on the back to the element of the display node after switching Scenery carries out brightness linear adjustment;
The element background value color of step S204, display node adjusted to brightness linear carry out color Serial regulation;
Step S205 is carried out the background colour of system control and system pop-up by the corresponding background color of preassigned pattern Switching.
The following detailed description of the detailed process of each step of the browser model switching method of this preferred embodiment.
In step s 201, browser model switching device reception pattern switching command, pattern switching instruction is used for will The browser model of corresponding terminal switches to preassigned pattern, as user's request by current browse webpage switch to Night or The instruction of page browsing is carried out under the preassigned patterns such as day mode.Subsequent browser model switching device refers to according to the pattern switching The display node tree (render tree) for obtaining current browse webpage is enabled, wherein display node tree is used to form current browse webpage and exists Display layout on screen.
Specifically referring to figure 3., the step of Fig. 3 is the second preferred embodiment of browser model switching method of the invention The flow chart of S201.Step S201 includes:
Step S301, browser model switching device instruct the file object for obtaining current browse webpage according to pattern switching Scheme-tree (Document Object Model), this document object scheme tree are used to indicate the page info of current browse webpage.
Step S302, the document object model tree that browser model switching device is obtained according to step S301 obtain current The display node of the display node tree of browsing pages, the display node tree can pass through the page info section in document object model tree Point conversion obtains.Then pass to step S202.
In step S202, the display section of the display node tree obtained in browser model switching device obtaining step S201 The element background value color of point (render node) can obtain the display section by the RenderStyle attribute of display node here The element background value color, such as setBackgroundColor, setBorderColor background colour attribute etc. of point.Subsequent browser mould The corresponding background color of preassigned pattern that formula switching device is determined by step S201 cuts the element background value color of display node It changes.As preassigned pattern be Night when, the element background value color for showing node is switched to dead color by browser model switching device; As preassigned pattern be day mode when, the element background value color for showing node is switched to light tone by browser model switching device.
Specifically, the color of the element background value color of original display node is then obtained if preassigned pattern is Night, it can The color of the element background value color is made of RGB three primary colors.As the chroma-luminance of original element background value color is more than or equal to setting Value, then to the trichromatic chroma-luminance of RGB multiplied by one less than one (such as 0.5) weighted value, to reduce the element background value color Chroma-luminance.If the chroma-luminance of original element background value color is less than setting value, then the trichromatic chroma-luminance of RGB is kept not Become.
If preassigned pattern is day mode, then the color of the element background value color of original display node is obtained, it can be by RGB tri- Primary colors carrys out the color of constitution element background colour.If the chroma-luminance of original element background value color is less than or equal to setting value, then to RGB Trichromatic chroma-luminance is greater than the weighted value of one (such as 1.2) multiplied by one to increase the chroma-luminance of the element background value color.Such as The chroma-luminance of original element background value color is greater than the set value, then keeps the trichromatic chroma-luminance of RGB constant.Then pass to step Rapid S203.
In step S203, browser model switching device is adjusted by gamma color range or primary display channels adjustment, to step The element background value color of display node after the switching of rapid S202 carries out brightness linear adjustment, as by setting SkPaint SkColorFilter carries out color matrix transformation.Darkening or the brightening isopleth of brightness either are carried out to current browse webpage in this way Property adjustment after, brightness linear entire current browse webpage adjusted is all not in luminance distortion, and the page for meeting user is clear Look at habit.Then pass to step S204.
In step S204, browser model switching device display node adjusted to the brightness linear of step S203 Element background value color carries out color Serial regulation, i.e., so that the element background value color of display node meets color-grading requirement.It is drawn as worked as The SkPaint of content processed indicates gradient color drafting when having SkShader:kLinear_GradientType attribute when, pass through The ColorFilter that SkPaint is arranged carries out matrixing.The linear entire current browse webpage adjusted of color will not all go out Existing color distortion, the page browsing requirement of the user of same further satisfaction.Then pass to step S205.
In step S205, browser model switching device presses predetermined the background colour of system control and system pop-up The corresponding background color of mode switches over.
Here system control includes but is not limited at least one of radio box control and check box control;Above-mentioned control Part is all the control of chromium localization, for example the control of the chromium under Android platform is handled all in src/ui mesh It under record, implements all in NativeThemeBase class, it is possible to unification is carried out in NativeThemeBase object The background color of change switches.
Here system pop-up includes but is not limited to page warning at least one of window and password prompt window.Such as Chromeshell under Android platform realizes that under src/chrome catalogue, such background color must switch all in java Layer, is also easier to realize.
The browser model handoff procedure of the browser model switching method of this preferred embodiment is completed in this way.
On the basis of first preferred embodiment, the browser model switching method of this preferred embodiment is simultaneously also to system Control and the background colour of system pop-up carry out background color switching, improve the accuracy of browser model switching.
The present invention also provides a kind of browser model switching devices, and referring to figure 4., Fig. 4 is browser model of the invention The structural schematic diagram of the first preferred embodiment of switching device.On the browser model switching device of this preferred embodiment can be used The first preferred embodiment for the browser model switching method stated is implemented.The browser model switching device 40 includes display Node tree obtains module 41, the first background colour switching module 42, brightness linear adjustment module 43 and color Serial regulation module 44。
Show that node tree obtains module 41 and is used for reception pattern switching command, and current clear according to pattern switching instruction acquisition Look at the display node tree of the page, wherein pattern switching instruction is for switching to preassigned pattern for the browser model of corresponding terminal. First background colour switching module 42 is used for the element background value color to the display node on display node tree, corresponding by preassigned pattern Background color switches over.Brightness linear adjusts module 43 and is used to carry out brightness to the element background value color of the display node after switching Serial regulation.Element background value color of the color Serial regulation module 44 for display node adjusted to brightness linear carries out color Serial regulation.
The browser model switching device 40 of this preferred embodiment in use, show that node tree obtains module 41 and receives first Pattern switching instruction, the pattern switching are instructed for the browser model of corresponding terminal to be switched to preassigned pattern, as user Current browse webpage is switched under the preassigned patterns such as Night or day mode the instruction for carrying out page browsing by request.Then Show that node tree obtains module 41 and instructs the display node tree (render tree) for obtaining current browse webpage according to the pattern switching, Wherein show that node tree is used to form the display layout of current browse webpage on the screen.
Subsequent first background colour switching module 42 obtains the display that display node tree obtains the display node tree that module obtains The element background value color of node (render node) can obtain the display by the RenderStyle attribute of display node here Element background value color of node, such as setBackgroundColor, setBorderColor background colour attribute etc..Subsequent first back Scenery switching module 42 obtains the determining corresponding background color of preassigned pattern of module to the member of display node by display node tree Plain background colour switches over.As preassigned pattern be Night when, browser model switching device will show node element back Scenery is switched to dead color;As preassigned pattern be day mode when, browser model switching device will show the element background value of node Color is switched to light tone.
Then element of the brightness linear adjustment module 43 to the display node after the switching of the first background colour switching module 42 Background colour carries out brightness linear adjustment.Either current browse webpage darken in this way or the brightening isopleth of brightness adjusts Afterwards, brightness linear entire current browse webpage adjusted is all not in luminance distortion, meets the page browsing habit of user.
Brightness linear adjusted display node of the last color Serial regulation module 44 to brightness linear adjustment module 43 Element background value color carry out color Serial regulation, i.e., so that display node element background value color meet color-grading requirement.Color Entire current browse webpage after Serial regulation is all not in color distortion, the page browsing of the user of same further satisfaction It is required that.
The browser model handoff procedure of the browser model switching device 40 of this preferred embodiment is completed in this way.
The display section that the browser model switching device of this preferred embodiment passes through the display node tree of current browse webpage The color and brightness adjustment of the element background value color of point, realize the switching of browser model;And above-mentioned adjustment mode is compatible In the browser of different Chromium kernel versions.
Referring to figure 5., Fig. 5 is the structural representation of the second preferred embodiment of browser model switching device of the invention Figure;The second preferred reality of above-mentioned browser model switching method can be used in the browser model switching device of this preferred embodiment Example is applied to be implemented.The browser model switching device 50 includes that display node tree obtains module 51, the first background colour switches mould Block 52, brightness linear adjustment module 53, color Serial regulation module 54 and the second background colour switching module 55.
Show that node tree obtains module 51 and is used for reception pattern switching command, and current clear according to pattern switching instruction acquisition Look at the display node tree of the page, wherein pattern switching instruction is for switching to preassigned pattern for the browser model of corresponding terminal. First background colour switching module 52 is used for the element background value color to the display node on display node tree, corresponding by preassigned pattern Background color switches over.Brightness linear adjustment module 53 by gamma color range for adjusting or primary display channels adjust, to cutting The element background value color of display node after changing carries out brightness linear adjustment.Color Serial regulation module 54 is used for brightness linear tune The element background value color of display node after whole carries out color Serial regulation.Second background colour switching module 55 is used for system control And the background colour of system pop-up, it is switched over by the corresponding background color of preassigned pattern.
Fig. 6 is please referred to, Fig. 6 is the display node tree of the second preferred embodiment of browser model switching device of the invention Obtain the structural schematic diagram of module.The display node tree obtains module 51 and includes Document Object Model tree acquiring unit 61 and show Show node tree acquiring unit 62.
Document Object Model tree acquiring unit 61 is used to instruct the file pair for obtaining current browse webpage according to pattern switching As scheme-tree.Show that node tree acquiring unit 62 is used to obtain the display section of current browse webpage according to document dbject model book Point tree.
The browser model switching device 50 of this preferred embodiment in use, show that node tree obtains module 51 and receives first Pattern switching instruction, the pattern switching are instructed for the browser model of corresponding terminal to be switched to preassigned pattern, as user Current browse webpage is switched under the preassigned patterns such as Night or day mode the instruction for carrying out page browsing by request.Then Show that node tree obtains module 51 and instructs the display node tree (render tree) for obtaining current browse webpage according to the pattern switching, Wherein show that node tree is used to form the display layout of current browse webpage on the screen.
The process specifically includes:
The Document Object Model tree acquiring unit 61 that display node tree obtains module 51 is obtained according to pattern switching instruction to be worked as The Document Object Model tree (Document Object Model) of preceding browsing pages, this document object scheme tree are worked as indicating The page info of preceding browsing pages.
Show that node tree obtains the display node tree acquiring unit 62 of module 51 according to Document Object Model tree acquiring unit The document object model tree of acquisition, obtains the display node tree of current browse webpage, and the display node of the display node tree can lead to The page info node conversion crossed in document object model tree obtains.
Subsequent first background colour switching module 52 obtains the aobvious of the display node tree that display node tree acquisition module 51 obtains Show the element background value color of node (render node), it is aobvious can be obtained by the RenderStyle attribute of display node for this here Show element background value color of node, such as setBackgroundColor, setBorderColor background colour attribute etc..Subsequent first Background colour switching module 52 obtains the determining corresponding background color of preassigned pattern of module 51 to display node by display node tree Element background value color switch over.As preassigned pattern be Night when, browser model switching device will show the member of node Plain background colour is switched to dead color;As preassigned pattern be day mode when, browser model switching device will show the element of node Background colour is switched to light tone.
Specifically, the color of the element background value color of original display node is then obtained if preassigned pattern is Night, it can The color of the element background value color is made of RGB three primary colors.As the chroma-luminance of original element background value color is more than or equal to setting Value, then to the trichromatic chroma-luminance of RGB multiplied by one less than one (such as 0.5) weighted value, to reduce the element background value color Chroma-luminance.If the chroma-luminance of original element background value color is less than setting value, then the trichromatic chroma-luminance of RGB is kept not Become.
If preassigned pattern is day mode, then the color of the element background value color of original display node is obtained, it can be by RGB tri- Primary colors carrys out the color of constitution element background colour.If the chroma-luminance of original element background value color is less than or equal to setting value, then to RGB Trichromatic chroma-luminance is greater than the weighted value of one (such as 1.2) multiplied by one to increase the chroma-luminance of the element background value color.Such as The chroma-luminance of original element background value color is greater than the set value, then keeps the trichromatic chroma-luminance of RGB constant.
Then brightness linear adjustment module 53 is adjusted by gamma color range or primary display channels adjust, and is cut to the first background colour The element background value color of display node after changing the mold the switching of block carries out brightness linear adjustment, as by setting SkPaint SkColorFilter carries out color matrix transformation.Darkening or the brightening isopleth of brightness either are carried out to current browse webpage in this way Property adjustment after, brightness linear entire current browse webpage adjusted is all not in luminance distortion, and the page for meeting user is clear Look at habit.
Brightness linear adjusted display node of the subsequent color Serial regulation module 54 to brightness linear adjustment module 53 Element background value color carry out color Serial regulation, i.e., so that display node element background value color meet color-grading requirement.Such as work as When the SkPaint for drawing content indicates gradient color drafting when having SkShader:kLinear_GradientType attribute, lead to The ColorFilter for crossing setting SkPaint carries out matrixing.The linear entire current browse webpage adjusted of color all will not There is color distortion, the page browsing requirement of the user of same further satisfaction.
The second last background colour switching module 55 is corresponded to the background colour of system control and system pop-up by preassigned pattern Background color switch over.
Here system control includes but is not limited at least one of radio box control and check box control;Above-mentioned system System control is all the control of chromium localization, for example the control of the chromium under Android platform is handled all in src/ Under ui catalogue, implement all in NativeThemeBase class, it is possible to be carried out in NativeThemeBase object Unitized background color switching.
Here system pop-up includes but is not limited to page warning at least one of window and password prompt window.Such as Chromeshell under Android platform realizes that under src/chrome catalogue, such background color must switch all in java Layer, is also easier to realize.
The browser model handoff procedure of the browser model switching device 50 of this preferred embodiment is completed in this way.
On the basis of first preferred embodiment, the browser model switching device of this preferred embodiment is simultaneously also to system Control and the background colour of system pop-up carry out background color switching, improve the accuracy of browser model switching.
Browser model switching method of the invention and switching device pass through the aobvious of the display node tree of current browse webpage The color and brightness adjustment for showing the element background value color of node, realize the switching of browser model;And above-mentioned adjustment mode can It is compatible in the browser of different Chromium kernel versions;The browser for solving existing Chromium kernel cannot be compatible with The technical issues of browser model switching of different Chromium kernel versions.
" component ", " module ", " system ", " interface ", " process " etc. are generally intended to as used herein the term Refer to computer related entity: hardware, the combination of hardware and software, software or software in execution.For example, component can be but not It is limited to be the process on a processor of running, processor, object, executable application, thread, program and/or the computer executed. By diagram, both the application and the controller run on the controller can be component.One or more components can have It is in the process executed and/or thread, and component can be located on a computer and/or be distributed in two or more meters Between calculation machine.
Moreover, claimed theme may be implemented as generating software using standard program and/or engineering technology, consolidate Part, hardware or any combination thereof are to control the method, apparatus or manufacture that computer realizes disclosed theme.It is used herein Term " manufacture " be intended to comprising can be from any computer readable device, carrier or the computer program of medium access.Certainly, Those skilled in the art will appreciate that many modifications can be carried out to the configuration, without departing from claimed theme range or Spirit.
There is provided herein the various operations of embodiment.In one embodiment, one or more operations can be with structure At the computer-readable instruction stored on one or more computer-readable mediums, will make to succeed in one's scheme when being executed by electronic equipment It calculates equipment and executes the operation.Describing the sequences of some or all of operations, to should not be construed as to imply that these operations necessarily suitable Sequence is relevant.It will be appreciated by those skilled in the art that the alternative sequence of the benefit with this specification.Furthermore, it is to be understood that Not all operation must exist in each embodiment provided in this article.
Moreover, word " preferred " used herein means serving as example, example or illustration.Feng Wen is described as " preferably " any aspect or design be not necessarily to be construed as than other aspect or design it is more advantageous.On the contrary, the use purport of word " preferred " Concept is being proposed in specific ways.Term "or" as used in this application is intended to mean the "or" for including and non-excluded "or".That is, unless specified otherwise or clear from the context, " X uses A or B " means that nature includes any one of arrangement. That is, if X uses A;X uses B;Or X uses A and B both, then " X uses A or B " is met in aforementioned any example.
Moreover, although the disclosure, this field skill has shown and described relative to one or more implementations Art personnel will be appreciated that equivalent variations and modification based on the reading and understanding to the specification and drawings.The disclosure include it is all this The modifications and variations of sample, and be limited only by the scope of the following claims.In particular, to by said modules (such as element, Resource etc.) the various functions that execute, term for describing such components is intended to correspond to the specified function for executing the component The random component (unless otherwise instructed) of energy (such as it is functionally of equal value), even if illustrated herein with execution in structure The disclosure exemplary implementations in function open structure it is not equivalent.In addition, although the special characteristic of the disclosure Through being disclosed relative to the only one in several implementations, but this feature can with such as can be to given or specific application For be expectation and one or more other features combinations of other advantageous implementations.Moreover, with regard to term " includes ", " tool Have ", " containing " or its deformation be used in specific embodiments or claims for, such term be intended to with term The similar mode of "comprising" includes.
Each functional unit in the embodiment of the present invention can integrate in a processing module, be also possible to each unit list It is solely physically present, can also be integrated in two or more units in a module.Above-mentioned integrated module can both use Formal implementation of hardware can also be realized in the form of software function module.If the integrated module is with software function The form of module is realized and when sold or used as an independent product, also can store in computer-readable storage Jie In matter.Storage medium mentioned above can be read-only memory, disk or CD etc..Above-mentioned each device or system, can be with Execute the method in correlation method embodiment.
In conclusion although the present invention has been disclosed above in the preferred embodiment, but above preferred embodiment is not to limit The system present invention, those skilled in the art can make various changes and profit without departing from the spirit and scope of the present invention Decorations, therefore protection scope of the present invention subjects to the scope of the claims.

Claims (7)

1. a kind of browser model switching method, which is characterized in that described clear applied to the browser based on chromium kernel Device mode switching method of looking at includes:
Reception pattern switching command, and the Document Object Model tree for obtaining current browse webpage is instructed according to the pattern switching, And the display node tree of the current browse webpage is obtained according to the Document Object Model tree, the display of the display node tree Node can be converted by the page info node in Document Object Model tree and be obtained, wherein pattern switching instruction is for by phase The browser model of terminal is answered to switch to preassigned pattern;
To the element background value color of the display node on the display node tree, carried out by the corresponding background color of the preassigned pattern Switching;
Brightness linear adjustment is carried out to the element background value color of the display node after switching, wherein adjusted by gamma color range or Primary display channels adjustment carries out color matrix transformation to the element background value color of the display node after switching, and then realizes bright Serial regulation is spent, such as preassigned pattern is Night, right if the chroma-luminance of original element background value is greater than the set value Trichromatic chroma-luminance reduces the chroma-luminance of the element background value color multiplied by one less than one weighted value;Such as pre- cover half Formula is day mode, if the chroma-luminance of original element background value color is less than or equal to setting value, to trichromatic chroma-luminance Reduce the chroma-luminance of the element background value color multiplied by a weighted value greater than one;And
The element background value color of the display node adjusted to brightness linear carries out color Serial regulation.
2. browser model switching method according to claim 1, which is characterized in that described adjusted to brightness linear After the step of element background value color of the display node carries out color Serial regulation further include:
To the background colour of system control and system pop-up, switched over by the corresponding background color of the preassigned pattern.
3. browser model switching method according to claim 2, which is characterized in that the system control includes but unlimited In at least one of radio box control and check box control;The system pop-up include but is not limited to the page warning window and At least one of password prompt window.
4. a kind of browser model switching device, which is characterized in that applied to the browser based on chromium kernel, the dress It sets and includes:
It shows that node tree obtains module, is used for reception pattern switching command, and current clear according to pattern switching instruction acquisition It lookes at the Document Object Model tree of the page, and obtains the display node of the current browse webpage according to the Document Object Model tree Tree, the display node of the display node tree can be converted by the page info node in Document Object Model tree to be obtained, wherein The pattern switching instruction is for switching to preassigned pattern for the browser model of corresponding terminal;
First background colour switching module, for the element background value color to the display node on the display node tree, by described pre- The corresponding background color of mould-fixed switches over;
Brightness linear adjusts module, carries out brightness linear adjustment for the element background value color to the display node after switching, It is wherein adjusted by gamma color range or primary display channels adjusts, face is carried out to the element background value color of the display node after switching Color matrixing, and then realize brightness linear adjustment, such as preassigned pattern is Night, if the color of original element background value Color brightness is greater than the set value, then to trichromatic chroma-luminance multiplied by one less than one weighted value to reduce the element background value The chroma-luminance of color;If preassigned pattern is day mode, if the chroma-luminance of original element background value color is less than or equal to setting value, Then reduce the chroma-luminance of the element background value color multiplied by a weighted value greater than one to trichromatic chroma-luminance;And
Color Serial regulation module carries out color line for the element background value color to the brightness linear display node adjusted Property adjustment.
5. browser model switching device according to claim 4, which is characterized in that the browser model switching device Further include:
Second background colour switching module, it is corresponding by the preassigned pattern for the background colour to system control and system pop-up Background color switch over.
6. browser model switching device according to claim 5, which is characterized in that the system control includes but unlimited In at least one of radio box control and check box control;The system pop-up include but is not limited to the page warning window and At least one of password prompt window.
7. a kind of storage medium, is stored thereon with computer program, which is characterized in that when the computer program on computers When operation, so that the computer executes browser model switching method as described in any one of claims 1 to 3.
CN201511031277.1A 2015-12-30 2015-12-30 Browser model switching method and switching device Active CN105701165B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511031277.1A CN105701165B (en) 2015-12-30 2015-12-30 Browser model switching method and switching device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511031277.1A CN105701165B (en) 2015-12-30 2015-12-30 Browser model switching method and switching device

Publications (2)

Publication Number Publication Date
CN105701165A CN105701165A (en) 2016-06-22
CN105701165B true CN105701165B (en) 2019-08-13

Family

ID=56226762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511031277.1A Active CN105701165B (en) 2015-12-30 2015-12-30 Browser model switching method and switching device

Country Status (1)

Country Link
CN (1) CN105701165B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126725B (en) * 2016-06-30 2022-10-11 北京小米移动软件有限公司 Page display method and device
CN107562447B (en) * 2016-06-30 2021-07-13 阿里巴巴(中国)有限公司 Picture processing device and method and user terminal
CN107797941B (en) * 2016-09-06 2020-07-07 华为技术有限公司 Cache coloring memory allocation method and device for search tree
CN106648579A (en) * 2016-09-12 2017-05-10 北京量科邦信息技术有限公司 Method and system of native app switching between night mode and day mode
CN106484396B (en) * 2016-09-18 2020-03-03 北京京东尚科信息技术有限公司 Night mode switching method and device and terminal equipment
CN106453852A (en) * 2016-09-20 2017-02-22 深圳鼎智通讯股份有限公司 Screen color adjustment system and method for Android terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258038A (en) * 2013-05-17 2013-08-21 广州市动景计算机科技有限公司 Method and device for synchronizing display modes between browser and webpage
CN103327194A (en) * 2013-06-18 2013-09-25 广东欧珀移动通信有限公司 Mode switching method and device for browser skin brightness
CN104346403A (en) * 2013-08-07 2015-02-11 腾讯科技(深圳)有限公司 Browser page display method and device as well as browser and terminal
CN105094759A (en) * 2014-04-29 2015-11-25 广州市动景计算机科技有限公司 Browse mode switch treatment method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8213917B2 (en) * 2006-05-05 2012-07-03 Waloomba Tech Ltd., L.L.C. Reusable multimodal application
CN102760139A (en) * 2011-04-29 2012-10-31 国际商业机器公司 Webpage processing method and webpage processing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258038A (en) * 2013-05-17 2013-08-21 广州市动景计算机科技有限公司 Method and device for synchronizing display modes between browser and webpage
CN103327194A (en) * 2013-06-18 2013-09-25 广东欧珀移动通信有限公司 Mode switching method and device for browser skin brightness
CN104346403A (en) * 2013-08-07 2015-02-11 腾讯科技(深圳)有限公司 Browser page display method and device as well as browser and terminal
CN105094759A (en) * 2014-04-29 2015-11-25 广州市动景计算机科技有限公司 Browse mode switch treatment method and device

Also Published As

Publication number Publication date
CN105701165A (en) 2016-06-22

Similar Documents

Publication Publication Date Title
CN105701165B (en) Browser model switching method and switching device
US10565293B2 (en) Synchronizing DOM element references
US11170159B1 (en) System and method for using a dynamic webpage editor
CN109446570B (en) Business process display method, device, computer equipment and storage medium
US8655112B2 (en) Method and apparatus for an improved workflow for digital image editing
CN103593370B (en) The method and browser of expanded application are realized in a browser
CN104156222A (en) Method for self-defining Android equipment desktop
CN104239067B (en) The preparation method and device of miniature client
CN104951311B (en) A kind of page animation method and device
CN103412748A (en) Display control method, device and system for user interface of embedded platform
CN104461614A (en) Method for processing theme resource and electronic device
CN104461634B (en) The loading method and device of sharing module on webpage
JP2018073125A5 (en) Server apparatus, information processing method, and program
CN102253986A (en) Method and device for improving webpage displaying effect in multiple terminals
CN106210918A (en) The update method of a kind of user interface and system
CN104793837B (en) Image generation method and device
CN105159673A (en) Method and device for setting control style
WO2016201813A1 (en) Dynamic layout method and system based on android
CN105204883B (en) A kind of plug-in unit loading processing method and device
US20130124686A1 (en) System and a Method for Sharing Computing Resources Associated to Scientific Publications
CN105373565A (en) Webpage processing method and apparatus
CN109960553A (en) A kind of more window context rendering methods and system
US11562003B2 (en) Representing search results via a three-dimensional matrix
KR101341996B1 (en) N-screen layout system using semantic web tag of html 5 and method threof
CN104850298A (en) Information processing method and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210413

Address after: 523860 Room 101, F 2, No.18, Wusha Haibin Road, Chang'an Town, Dongguan City, Guangdong Province

Patentee after: GUANGDONG MINGCHUANG SOFTWARE TECHNOLOGY Co.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

TR01 Transfer of patent right