Webkit之常用物件API梳理

2021-07-07 06:45:19 字數 3050 閱讀 6352

1)node

#nodetype nodetype()//獲取節點型別

#containernode parentnode()//容器節點

#element parentelement()//父親元素

#node

>>previoussibling()、nextsibling()//前後節點

>>childnodes()、firstchild()、lastchild()//孩子兄弟

>>lastdescendant()、firstdescendant//繼承節點

#namednodemap attributes()//獲取屬性列表

#scriptexecutioncontext scriptexecutioncontext()//script執行上下文。

#renderobject renderer()、nextrenderer()、previousrenderer()//渲染物件

#renderbox renderbox()//渲染box

#renderboxmodelobject renderboxmodelobject()//渲染box模型

#renderstyle renderstyle()、computedstyle()//渲染style資訊體

#nodelist

>>getelementsbytagname()

>>getelementsbytagnamens()

>>getelementsbyname()

>>getelementsbyclassname()

2)renderobject

#document document()//獲取文件物件

#frame frame()//資料frame

#node node()//資料節點

#renderview view()//渲染物理view

#renderstyle style()//渲染資訊

3)renderstyle

#inheritfrom():繼承父元素

#renderstyle//獲取渲染樣式

>>addcachedpseudostyle()、removecachedpseudostyle()、getcachedpseudostyle()

#create()、createdefaultstyle()、createanonymousstyle()

#clone()//轉殖

4)rendertheme

#建立:defaulttheme()

#操作:

void adjuststyle()//style發生改變時需要排程此函式。

bool paint(renderobject*, const paintinfo&, const intrect&);

//繪製renderobject的的背景,前景一般由engine提供(button`s text)

5)renderthemeqt

#static void initstyleoption(qwidget *widget, qstyleoption& option)

//根據qwidget的特性提取qstyleoption資訊。

#qstylefactory::create(qlatin1string("windows"));

//建立預設的qstyle式樣。

#繪製操作:

paintbutton(renderobject* o, const paintinfo& i, const intrect& r)

painttextfield():繪製文字域

painttextarea():繪製文字域

paintmenulist():選單列表

paintmenulistbutton():選單列表按鈕

paintprogressbar():繪製進度條

paintslidertrack():繪製滑動條(slider)

paintsliderthumb():繪製slider的首部

paintsearchfield():繪製搜查域

paintsearchfieldcancelbutton

paintsearchfielddecoration

paintsearchfieldresultsdecoration

paintmediabackground

paintmediafullscreenbutton

paintmediamutebutton

paintmediaseekbackbutton

paintcheckbox

paintradiobox

6)stylepainter介紹(qwidget、qpainter、qstyle的樞紐帶)

#構造:

>>explicit stylepainter(renderthemeqt*, const paintinfo&);

#繪製操作:

void drawprimitive(qstyle::primitiveelement pe, const qstyleoption& opt);

void drawcontrol(qstyle::controlelement ce, const qstyleoption& opt);

void drawcomplexcontrol(qstyle::complexcontrol cc, const qstyleoptioncomplex& opt);

7)event

#路徑:webcore/dom/event.h

8)webcore/generated/htmlnames.h

#屬性、標籤

9)htmlanchorelement

#基本屬性:

>>name、target、path、host、port、href、protecol、search、text

#負責解析標籤中的屬性,層層呼叫的關係邏輯,全面解析屬性。

#解析之後,然後對外提供判斷的介面( isurlattribute() )

11)網路載入端的api

resourcehandle::prepareforurl(document()->completeurl(parsedurl))

Android Paint 高階常用API梳理

paint還是比較複雜的,這裡只是一些常見的api舉例。結構很簡單,自定義乙個gradientlayout繼承自view,mainactivity的setcontentview new gradientlayout this 核心的api全部在gradientlayout中。1.首先是gradien...

XHR常用物件API

1.xmlhttprequest 建立xhr物件的建構函式 2.status 響應狀態碼值,比如200,404 標識著請求成功或者失敗 3.statustext 響應狀態文字 4.readystate 標識請求狀態的唯讀屬性 0 初始 1 open 之後 2 send 之後 3 請求中 4 請求完成...

Calendar日曆物件常用API

1 通過calendar物件實現獲取上個月第一天與上個月第二天 建立日曆物件 calendar calendar calendar.getinstance dateformat df new dateformat yyyy mm dd hh mm ss 初始化日曆時間為當前時間 calendar.s...