关闭

WebKit之零散记忆

138人阅读 评论(0) 收藏 举报
分类:

1、Document::attach()

>> 创建RenderArena = adoptPtr(new RenderArena);

>> 创建RenderView:setRenderer(new (m_renderArena.get()) RenderView(this, view()));

>> TreeScope::attach();

2、detach()

>> 清除Cache对象:clearAXObjectCache();

>> 停止DOM对象:stopActiveDOMObjects();

>> 事件终止:m_eventQueue->cancelQueuedEvents();

>> 发送安静事件:documentWillBecomeInactive();

>> 关闭ScrollBar:

           FrameView* view = m_frame->view();

        if (view)

            view->detachCustomScrollbars();

>> 开始不接受事件:ownerPage->chrome()->client()->needTouchEvents(false);

>> TreeScope::detach();

>> m_renderArena.clear();

>> unscheduleStyleRecalc(); 停止样式更新吗?

2、强行进行样式计算

recalcStyle(Force);

3、根据Node + RenderStyle => RenderObject对象

RenderObject* RenderObject::createObject(Node* node, RenderStyle* style)

>>    Document* doc = node->document();

>>    RenderArena* arena = doc->renderArena();

4、创建RenderObject

>>PassRefPtr<ChildType> HTMLConstructionSite::attach(ContainerNode* rawParent, PassRefPtr<ChildType> prpChild)

>>void Element::attach()

>>NodeRendererFactory(this).createRendererIfNeeded();

>>RenderObject* newRenderer = createRendererAndStyle();

>>RenderObject* HTMLElement::createRenderer(RenderArena* arena, RenderStyle* style)

>>if (hasLocalName(wbrTag))

     return new (arena) RenderWordBreak(this);

  return RenderObject::createObject(this, style);

>>RenderObject* RenderObject::createObject(Node* node, RenderStyle* style)

5、特殊的几个依靠标签名,大部分依赖于RenderStyle::display()属性进行创建~

6、RenderStyle的数据内容

style->contentData()

7、<img>标签设ImageResource对象。

image->setImageResource(RenderImageResource::create());

>> RenderImageResource::RenderImageResource()

8、标签的解析处理

case HTMLToken::StartTag:

     processStartTag(token);

break;

9、RenderThemeQt的创建时机:

>>QWebPage构造

>>QWebPagePrivate构造函数

>>Page构造函数

>>Chrome对象、SelectionController、FocusController

  DragController、ContextMenuController、InspectorController

  GeolocationController、DeviceMotionController、DeviceOrientationController

  MediaStreamController、Settings、ProgressTracker 

  BackForwardController、RenderTheme::themeForPage

10、浏览器的设计

>>个性化的交互方式(select标签效果)

>>事件特性(摇杆等操作)

11、RenderThemeQt的执行内容

>>一个主题是为一个Page对象所定制的,而非一个Frame。

>>创建样式 m_fallbackStyle = QStyleFactory::create(QLatin1String("windows"));

12、iframe的创建过程

HTMLIFRrameElement -> RenderIFrame -> RenderFrameBase -> RenderPart -> RenderWidget -> RenderReplaced -> RenderBox

13、RenderObject 与 GraphicsContext的教诲关系

>> void RenderBoxModelObject::paintFillLayerExtended

>> 业务细节调用GraphicsContext的API内容

>> void GraphicsContext::fillRoundedRect

14、QWevView事件触发

>>其他事件后->更新->paintEvent()操作

>>QWebView::paintEvent()

>>

>>ScrollView::paintScrollBars() -> ScrollBar::paint() -> ScrollBarThemeQt::paint()

>>创建StylePainter对象  StylePainter p(this, graphicsContext);

>>

15、上下文就是所谓的QPainter

painter = static_cast<QPainter*>(context->platformContext());

16、<select>

HTMLSelectElement::createRenderer() -> return new (arena) RenderMenuList(this);

RenderFlexibleBox

17、

>> void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)

    if (!isText() && style)

        setStyle(animation()->updateAnimations(this, style.get()));

    else

        setStyle(style);

>> styleWillChange(diff, style.get());//设置样式之后的结果

>> StyleDifference updatedDiff = adjustStyleDifference(diff, contextSensitiveProperties);

>> Style设定后决定是否需要layout或是重绘

>> 如果字体发生改变,则需要更新OptionWidth

    if (fontChanged)

        updateOptionsWidth();

>>取出SelectElement的itemList成员列表

const Vector<Element*>& listItems = toSelectElement(static_cast<Element*>(node()))->listItems();

Element* element = listItems[i];

OptionElement* optionElement = toOptionElement(element);


11、SelectElement

SelectElement* select = toSelectElement(static_cast<Element*>(node()));

12、设置String注意清空strip效果

setText(text.stripWhiteSpace());

>>设置Text之后就立刻调用addChild()

void RenderMenuList::addChild(RenderObject* newChild, RenderObject* beforeChild)

13、select标签也是属于form内部的吗?

void HTMLFormControlElement::attach()

14、点击select标签的显示效果参见(showPopup函数)

void RenderMenuList::showPopup()

15、创建popup对象(为RenderObject创建popup对象)

m_popup = document()->page()->chrome()->createPopupMenu(this);

PassRefPtr<PopupMenu> Chrome::createPopupMenu(PopupMenuClient* client) const

{

    return m_client->createPopupMenu(client);

}

Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

PassRefPtr<PopupMenu> ChromeClientQt::createPopupMenu(PopupMenuClient* client) const

{

return adoptRef(new PopupMenuQt(client, this));

}

PopupMenuQt->show(){

>>PassOwnPtr<QWebSelectMethod> ChromeClientQt::createSelectPopup() const

>>OwnPtr<QWebSelectMethod> m_popup;

>>检测是否有QT_NO_COMBOBOX宏

>>

}


155、QPlatformPlugin::createSelectInputMethod() 创建selectInupt方法

>> QWebKitPlatformPlugin* QtPlatformPlugin::plugin()

>> load(pluginPath) ?? 是采用插件的形式?还是重载QWebPage的方式

>>Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp ??


16、SelectElement接受menuList的默认响应事件

>> void SelectElement::menuListDefaultEventHandler

>> 谁响应事件?谁负责绘制?谁负责存储数据?

17、PopupMenuClient的实现

>valueChanged、selectionChanged

>itemText、itemLabel、itemIcon、itemToolTip、itemAccessText

>itemIsEnabled、itemStyle、MenuStyle

>clientInsetLeft、clientInsetRight

>listSize、selectedIndex

>POPiupDidHide

>itemIsSeparator、isLabel、isSelected

>sholdPopOver

>hostwindow、FontSelector

>createScrollbar

21、Chrome、ChromeClinet负责内容

>支持全屏?进入全屏?退出全屏?要求全屏?

>允许突然终止、不允许突然终止

>是否有OpenPopup?创建PopupMenu、创建SearchPOPupMenu?

Source/Webkit/qt|wince|mac|../WebCoreSupport/ChromeClientQt.cpp

>

22、交由QWebPage进行实现的Popup效果

QWebSelectMethod *QWebPagePrivate::createSelectPopup()

{

return new QtFallbackWebPopup(this);

}

>> m_combo = new QtWebComboBox();

   QComboBox()

>> populate(data);

>> m_combo->showPopupAtCursorPosition();

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:131884次
    • 积分:3864
    • 等级:
    • 排名:第8255名
    • 原创:243篇
    • 转载:159篇
    • 译文:0篇
    • 评论:2条
    文章分类
    最新评论