Tree Construction流程由一个状态“Insertion Mode”进行控制,它影响token的处理以及是否支持CDATA部分,HTML5中给出了详细的规则(http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#the-insertion-mode)。它也控制了在特定状态下能够处理的token,比如在head里面,再出现head标签,显然是不应该处理的。
// raw tree manipulation virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true); virtual void appendChildNode(RenderObject*, bool fullAppend = true); virtual void insertChildNode(RenderObject* child, RenderObject* before, bool fullInsert = true); // Designed for speed. Don't waste time doing a bunch of work like layer updating and repainting when we know that our // change in parentage is not going to affect anything. virtual void moveChildNode(RenderObject*);
virtual void paint(PaintInfo&, int tx, int ty);
/* * This function should cause the Element to calculate its * width and height and the layout of its content * * when the Element calls setNeedsLayout(false), layout() is no * longer called during relayouts, as long as there is no * style sheet change. When that occurs, m_needsLayout will be * set to true and the Element receives layout() calls * again. */ virtual void layout() = 0;
三、RenderObject及子类对象的生成 1、CSSParser CSSParser类顾名思义,主要用来解析文本中各种CSS属性,并且有效的组织在一个RenderStyle对象中。 其主要方法parseValue、applyProperty的部分代码示例如下: bool CSSParser::parseValue(int propId, bool important) { ..................................................... case CSSPropertyFloat: // left | right | none | inherit + center for buggy CSS if (id == CSSValueLeft || id == CSSValueRight || id == CSSValueNone || id == CSSValueCenter) valid_primitive = true; break;
case CSSPropertyClear: // none | left | right | both | inherit if (id == CSSValueNone || id == CSSValueLeft || id == CSSValueRight|| id == CSSValueBoth) valid_primitive = true; break;
case CSSPropertyWebkitBoxAlign: if (id == CSSValueStretch || id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline) valid_primitive = true; break; ..................................................... case CSSPropertyWebkitBoxPack: if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueJustify) valid_primitive = true; break; .................................................... }
void CSSStyleSelector::applyProperty(int id, CSSValue *value) { case CSSPropertyOpacity: HANDLE_INHERIT_AND_INITIAL(opacity, Opacity) if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER) return; // Error case. // Clamp opacity to the range 0-1 m_style->setOpacity(min(1.0f, max(0.0f, primitiveValue->getFloatValue()))); return; case CSSPropertyWebkitBoxAlign: { HANDLE_INHERIT_AND_INITIAL(boxAlign, BoxAlign) if (!primitiveValue) return; EBoxAlignment boxAlignment = *primitiveValue; if (boxAlignment != BJUSTIFY) m_style->setBoxAlign(boxAlignment); return; } ................................................... }
RenderObject* Element::createRenderer(RenderArena* arena, RenderStyle* style) { if (document()->documentElement() == this && style->display() == NONE) { // Ignore display: none on root elements. Force a display of block in that case. RenderBlock* result = new (arena) RenderBlock(this); if (result) result->setAnimatableStyle(style); return result; } return RenderObject::createObject(this, style); }
switch (style->display()) {//往往在CSSStyleSelector::styleForElement或CSSStyleSelector::adjustRenderStyle时//调用setDisplay()以确定其display属性。 case NONE: break; case INLINE: o = new (arena) RenderInline(node); break; case BLOCK: o = new (arena) RenderBlock(node); break; case INLINE_BLOCK: o = new (arena) RenderBlock(node); break; case LIST_ITEM: o = new (arena) RenderListItem(node); break; case RUN_IN: case COMPACT: o = new (arena) RenderBlock(node); break; case TABLE: case INLINE_TABLE: o = new (arena) RenderTable(node); break; case TABLE_ROW_GROUP: case TABLE_HEADER_GROUP: case TABLE_FOOTER_GROUP: o = new (arena) RenderTableSection(node); break; case TABLE_ROW: o = new (arena) RenderTableRow(node); break; case TABLE_COLUMN_GROUP: case TABLE_COLUMN: o = new (arena) RenderTableCol(node); break; case TABLE_CELL: o = new (arena) RenderTableCell(node); break; case TABLE_CAPTION: o = new (arena) RenderBlock(node); break; case BOX: case INLINE_BOX: o = new (arena) RenderFlexibleBox(node); break; } return o; } 这样就不同的DOM树节点结合不同的显示属性,创建出不同的RenderObject子类对象,进而形成一个Render树。
(1)在RenderLayer::updateZOrderLists()函数里,通过一个for循环,把RenderBoxModelObject::styleDidChange()函数里,插入进来的 所有RenderLayer加入到m_posZOrderList。 m_posZOrderList的定义为:Vector* m_posZOrderList; 这个函数的调用过程如下: #0 0x42a61f40 in kill () from /lib/libc.so.0 #1 0x42052f14 in pthread_kill () from /lib/libpthread.so.0 #2 0x420534c8 in raise () from /lib/libpthread.so.0 #3 0x4167d438 in QWSSignalHandler::handleSignal () from /opt/lib/libQtGui.so.4 #4 #5 0x40e1fc78 in WebCore::RenderLayer::updateZOrderLists () from /opt/lib/libQtWebKit.so.4 #6 0x40e1fe7c in WebCore::RenderLayer::updateLayerListsIfNeeded () from /opt/lib/libQtWebKit.so.4 #7 0x40e1ff3c in WebCore::RenderLayer::hitTestLayer () from /opt/lib/libQtWebKit.so.4 #8 0x40e2043c in WebCore::RenderLayer::hitTestLayer () from /opt/lib/libQtWebKit.so.4 #9 0x40e2115c in WebCore::RenderLayer::hitTest () from /opt/lib/libQtWebKit.so.4 #10 0x408437c0 in WebCore::Document::prepareMouseEvent () from /opt/lib/libQtWebKit.so.4 #11 0x40c8b3e0 in WebCore::EventHandler::prepareMouseEvent () from /opt/lib/libQtWebKit.so.4 #12 0x40c96580 in WebCore::EventHandler::handleMouseMoveEvent () from /opt/lib/libQtWebKit.so.4 #13 0x40c96c0c in WebCore::EventHandler::mouseMoved () from /opt/lib/libQtWebKit.so.4 #14 0x40f4cf38 in WebCore::FrameLoaderClientQt::postProgressFinishedNotification () from /opt/lib/libQtWebKit.so.4 #15 0x40c16808 in WebCore::ProgressTracker::finalProgressComplete () from /opt/lib/libQtWebKit.so.4 #16 0x40c16954 in WebCore::ProgressTracker::progressCompleted () from /opt/lib/libQtWebKit.so.4 #17 0x40bb3518 in WebCore::FrameLoader::checkLoadCompleteForThisFrame () from /opt/lib/libQtWebKit.so.4 #18 0x40bbb008 in WebCore::FrameLoader::recursiveCheckLoadComplete () from /opt/lib/libQtWebKit.so.4 #19 0x40b9f57c in WebCore::DocumentLoader::removeSubresourceLoader () from /opt/lib/libQtWebKit.so.4 #20 0x40c2d51c in WebCore::SubresourceLoader::didFinishLoading () from /opt/lib/libQtWebKit.so.4 #21 0x40c23498 in WebCore::ResourceLoader::didFinishLoading () from /opt/lib/libQtWebKit.so.4 #22 0x40f0bb4c in WebCore::QNetworkReplyHandler::finish () from /opt/lib/libQtWebKit.so.4 #23 0x40f0c7f0 in WebCore::QNetworkReplyHandler::qt_metacall () from /opt/lib/libQtWebKit.so.4 #24 0x41f03374 in QMetaCallEvent::placeMetaCall () from /opt/lib/libQtCore.so.4 #25 0x41f061ac in QObject::event () from /opt/lib/libQtCore.so.4 #26 0x41697c30 in QApplicationPrivate::notify_helper () from /opt/lib/libQtGui.so.4 #27 0x41698b8c in QApplication::notify () from /opt/lib/libQtGui.so.4 #28 0x41eef1b4 in QCoreApplication::notifyInternal () from /opt/lib/libQtCore.so.4 #29 0x41ef42d0 in QCoreApplicationPrivate::sendPostedEvents () from /opt/lib/libQtCore.so.4 #30 0x00000000 in ?? ()
(2)在RenderLayer::paintLayer()函数里,会通过判断m_posZOrderList是否为空,来决定是否继续进行渲染。 代码: if (m_posZOrderList) for (Vector::iterator it = m_posZOrderList->begin(); it != m_posZOrderList->end(); ++it) it[0]->paintLayer(rootLayer, p, paintDirtyRect, paintRestriction, paintingRoot, overlapTestRequests, localPaintFlags); 通过这段代码,将m_posZOrderList里面所有的RenderLayer都渲染,它递归地回调到了paintLayer()函数。
函数调用关系: #0 0x42a60f40 in kill () from /lib/libc.so.0 #1 0x42051f14 in pthread_kill () from /lib/libpthread.so.0 #2 0x420524c8 in raise () from /lib/libpthread.so.0 #3 0x4167c438 in QWSSignalHandler::handleSignal () from /opt/lib/libQtGui.so.4 #4 #5 0x40db3c98 in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4 #6 0x40db3fdc in WebCore::RenderBlock::paintChildren () from /opt/lib/libQtWebKit.so.4 #7 0x40dc8b2c in WebCore::RenderBlock::paintObject () from /opt/lib/libQtWebKit.so.4 #8 0x40db3c04 in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4 重要点,从8到5递归调用。绘制需要重新绘制的元素。 #9 0x40e22ec0 in WebCore::RenderLayer::paintLayer () from /opt/lib/libQtWebKit.so.4 #10 0x40e22760 in WebCore::RenderLayer::paintLayer () from /opt/lib/libQtWebKit.so.4 #11 0x40e23430 in WebCore::RenderLayer::paint () from /opt/lib/libQtWebKit.so.4 #12 0x40cb3fa0 in WebCore::FrameView::paintContents () from /opt/lib/libQtWebKit.so.4 #13 0x40f60000 in QWebFramePrivate::renderPrivate () from /opt/lib/libQtWebKit.so.4 #14 0x40f90360 in QWebView::paintEvent () from /opt/lib/libQtWebKit.so.4 #15 0x416da7fc in QWidget::event () from /opt/lib/libQtGui.so.4 #16 0x40f8ff78 in QWebView::event () from /opt/lib/libQtWebKit.so.4 #17 0x41696c30 in QApplicationPrivate::notify_helper () from /opt/lib/libQtGui.so.4 #18 0x41697b8c in QApplication::notify () from /opt/lib/libQtGui.so.4 #19 0x41eee1b4 in QCoreApplication::notifyInternal () from /opt/lib/libQtCore.so.4 #20 0x416d83b0 in QWidgetPrivate::drawWidget () from /opt/lib/libQtGui.so.4 #21 0x41850394 in QWidgetBackingStore::sync () from /opt/lib/libQtGui.so.4 #22 0xbef9c790 in ?? () 4.表单输入控件(input)
表单输入控件。这里是的函数调用: #0 0x42a59f40 in kill () from /lib/libc.so.0 #1 0x4204af14 in pthread_kill () from /lib/libpthread.so.0 #2 0x4204b4c8 in raise () from /lib/libpthread.so.0 #3 0x41675438 in QWSSignalHandler::handleSignal () from /opt/lib/libQtGui.so.4 #4 #5 0x40e2ca74 in WebCore::RenderObject::isBody () from /opt/lib/libQtWebKit.so.4 #6 0x40f2b2c8 in WebCore::RenderThemeQt::paintButton () from /opt/lib/libQtWebKit.so.4 #7 0x40f299a4 in WebCore::RenderThemeQt::paintCheckbox () from /opt/lib/libQtWebKit.so.4 #8 0x40e6feb4 in WebCore::RenderTheme::paint () from /opt/lib/libQtWebKit.so.4 #9 0x40dd88a4 in WebCore::RenderBox::paintBoxDecorations () from /opt/lib/libQtWebKit.so.4 #10 0x40dbdb10 in WebCore::RenderBlock::paintObject () from /opt/lib/libQtWebKit.so.4 #11 0x40dac69c in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4 #12 0x40e1b28c in WebCore::RenderLayer::paintLayer () from /opt/lib/libQtWebKit.so.4 #13 0x40e1b524 in WebCore::RenderLayer::paintLayer () from /opt/lib/libQtWebKit.so.4 #14 0x40e1b524 in WebCore::RenderLayer::paintLayer () from /opt/lib/libQtWebKit.so.4 #15 0x40e1c2c0 in WebCore::RenderLayer::paint () from /opt/lib/libQtWebKit.so.4 #16 0x40caca60 in WebCore::FrameView::paintContents () from /opt/lib/libQtWebKit.so.4 #17 0x40f58ee0 in QWebFramePrivate::renderPrivate () from /opt/lib/libQtWebKit.so.4 #18 0x40f89098 in QWebView::paintEvent () from /opt/lib/libQtWebKit.so.4 #19 0x416d37fc in QWidget::event () from /opt/lib/libQtGui.so.4 #20 0x40f88ca4 in QWebView::event () from /opt/lib/libQtWebKit.so.4 #21 0x4168fc30 in QApplicationPrivate::notify_helper () from /opt/lib/libQtGui.so.4 #22 0x41690b8c in QApplication::notify () from /opt/lib/libQtGui.so.4 #23 0x41ee71b4 in QCoreApplication::notifyInternal () from /opt/lib/libQtCore.so.4 #24 0x416d13b0 in QWidgetPrivate::drawWidget () from /opt/lib/libQtGui.so.4 #25 0x41849394 in QWidgetBackingStore::sync () from /opt/lib/libQtGui.so.4 #26 0xbedb1790 in ?? ()
创建div对应的RenderObject函数调用: #0 0x42a5bf40 in kill () from /lib/libc.so.0 #1 0x4204cf14 in pthread_kill () from /lib/libpthread.so.0 #2 0x4204d4c8 in raise () from /lib/libpthread.so.0 #3 0x41677438 in QWSSignalHandler::handleSignal () from /opt/lib/libQtGui.so.4 #4 #5 0x40e34c98 in WebCore::RenderObject::RenderObject () from /opt/lib/libQtWebKit.so.4 #6 0x40de06a8 in WebCore::RenderBoxModelObject::RenderBoxModelObject () from /opt/lib/libQtWebKit.so.4 #7 0x40dde648 in WebCore::RenderBox::RenderBox () from /opt/lib/libQtWebKit.so.4 #8 0x40daba90 in WebCore::RenderBlock::RenderBlock () from /opt/lib/libQtWebKit.so.4 #9 0x40e840b0 in WebCore::TextControlInnerTextElement::createRenderer () from /opt/lib/libQtWebKit.so.4 ( 创建div对应的RenderObject) #10 0x40e849c0 in WebCore::TextControlInnerElement::attachInnerElement () from /opt/lib/libQtWebKit.so.4 #11 0x40e617e8 in WebCore::RenderTextControl::createSubtreeIfNeeded () from /opt/lib/libQtWebKit.so.4 (重要点) #12 0x40e6a958 in WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded () from /opt/lib/libQtWebKit.so.4 #13 0x40e6ac40 in WebCore::RenderTextControlSingleLine::updateFromElement () from /opt/lib/libQtWebKit.so.4 #14 0x40aa3430 in WebCore::HTMLFormControlElement::attach () from /opt/lib/libQtWebKit.so.4 #15 0x40ab7974 in WebCore::HTMLInputElement::attach () from /opt/lib/libQtWebKit.so.4 #16 0x40adeb94 in WebCore::HTMLParser::insertNode () from /opt/lib/libQtWebKit.so.4 #17 0x40adfa20 in WebCore::HTMLParser::parseToken () from /opt/lib/libQtWebKit.so.4 #18 0x40b01064 in WebCore::HTMLTokenizer::processToken () from /opt/lib/libQtWebKit.so.4 #19 0x40b15bec in WebCore::HTMLTokenizer::parseTag () from /opt/lib/libQtWebKit.so.4 #20 0x40b17c0c in WebCore::HTMLTokenizer::write () from /opt/lib/libQtWebKit.so.4 #21 0x40baf6b8 in WebCore::FrameLoader::write () from /opt/lib/libQtWebKit.so.4 #22 0x40f45fb4 in WebCore::FrameLoaderClientQt::committedLoad () from /opt/lib/libQtWebKit.so.4 #23 0x40ba4b8c in WebCore::FrameLoader::committedLoad () from /opt/lib/libQtWebKit.so.4 #24 0x40b8d904 in WebCore::DocumentLoader::commitLoad () from /opt/lib/libQtWebKit.so.4 #25 0x40c1ce1c in WebCore::ResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #26 0x40bf9cb8 in WebCore::MainResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #27 0x40c1c6b4 in WebCore::ResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #28 0x40f0561c in WebCore::QNetworkReplyHandler::forwardData () from /opt/lib/libQtWebKit.so.4 #29 0x40f067f0 in WebCore::QNetworkReplyHandler::qt_metacall () from /opt/lib/libQtWebKit.so.4 #30 0x41efd374 in QMetaCallEvent::placeMetaCall () from /opt/lib/libQtCore.so.4 #31 0x41f001ac in QObject::event () from /opt/lib/libQtCore.so.4 #32 0x41691c30 in QApplicationPrivate::notify_helper () from /opt/lib/libQtGui.so.4 #33 0x41692b8c in QApplication::notify () from /opt/lib/libQtGui.so.4 #34 0x41ee91b4 in QCoreApplication::notifyInternal () from /opt/lib/libQtCore.so.4 #35 0x41eee2d0 in QCoreApplicationPrivate::sendPostedEvents () from /opt/lib/libQtCore.so.4 #36 0x000a9f60 in ?? ()
创建HTMLDivElement函数调用: #0 0x42a5af40 in kill () from /lib/libc.so.0 #1 0x4204bf14 in pthread_kill () from /lib/libpthread.so.0 #2 0x4204c4c8 in raise () from /lib/libpthread.so.0 #3 0x41676438 in QWSSignalHandler::handleSignal () from /opt/lib/libQtGui.so.4 #4 #5 0x40e836d8 in WebCore::TextControlInnerElement::TextControlInnerElement () from /opt/lib/libQtWebKit.so.4 #6 0x40e83974 in WebCore::TextControlInnerTextElement::TextControlInnerTextElement () from /opt/lib/libQtWebKit.so.4 (构造函数里创建HTMLDivElement) #7 0x40e60f84 in WebCore::RenderTextControl::createSubtreeIfNeeded () from /opt/lib/libQtWebKit.so.4 (重要点) #8 0x40e6a1a0 in WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded () from /opt/lib/libQtWebKit.so.4 #9 0x40e6a488 in WebCore::RenderTextControlSingleLine::updateFromElement () from /opt/lib/libQtWebKit.so.4 #10 0x40aa31e8 in WebCore::HTMLFormControlElement::attach () from /opt/lib/libQtWebKit.so.4 #11 0x40ab772c in WebCore::HTMLInputElement::attach () from /opt/lib/libQtWebKit.so.4 #12 0x40ade94c in WebCore::HTMLParser::insertNode () from /opt/lib/libQtWebKit.so.4 #13 0x40adf7d8 in WebCore::HTMLParser::parseToken () from /opt/lib/libQtWebKit.so.4 #14 0x40b00e1c in WebCore::HTMLTokenizer::processToken () from /opt/lib/libQtWebKit.so.4 #15 0x40b159a4 in WebCore::HTMLTokenizer::parseTag () from /opt/lib/libQtWebKit.so.4 #16 0x40b179c4 in WebCore::HTMLTokenizer::write () from /opt/lib/libQtWebKit.so.4 #17 0x40baf470 in WebCore::FrameLoader::write () from /opt/lib/libQtWebKit.so.4 #18 0x40f459d4 in WebCore::FrameLoaderClientQt::committedLoad () from /opt/lib/libQtWebKit.so.4 #19 0x40ba4944 in WebCore::FrameLoader::committedLoad () from /opt/lib/libQtWebKit.so.4 #20 0x40b8d6bc in WebCore::DocumentLoader::commitLoad () from /opt/lib/libQtWebKit.so.4 #21 0x40c1cbd4 in WebCore::ResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #22 0x40bf9a70 in WebCore::MainResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #23 0x40c1c46c in WebCore::ResourceLoader::didReceiveData () from /opt/lib/libQtWebKit.so.4 #24 0x40f0503c in WebCore::QNetworkReplyHandler::forwardData () from /opt/lib/libQtWebKit.so.4 #25 0x40f06210 in WebCore::QNetworkReplyHandler::qt_metacall () from /opt/lib/libQtWebKit.so.4 #26 0x41efc374 in QMetaCallEvent::placeMetaCall () from /opt/lib/libQtCore.so.4 #27 0x41eff1ac in QObject::event () from /opt/lib/libQtCore.so.4 #28 0x41690c30 in QApplicationPrivate::notify_helper () from /opt/lib/libQtGui.so.4 #29 0x41691b8c in QApplication::notify () from /opt/lib/libQtGui.so.4 #30 0x41ee81b4 in QCoreApplication::notifyInternal () from /opt/lib/libQtCore.so.4 #31 0x41eed2d0 in QCoreApplicationPrivate::sendPostedEvents () from /opt/lib/libQtCore.so.4 #32 0x000a9f60 in ?? () 5.元素具体绘制
图片,文字,表单输入控件的绘制,都是通过从RenderBlock::paint () 开始,在RenderBlock::paintObject ()中,调用RenderBlock::paintContents ()函数, 来进行递归地绘制。在RenderBlock::paintContents ()函数里,有下面代码: if (childrenInline()) m_lineBoxes.paint(this, paintInfo, tx, ty); else paintChildren(paintInfo, tx, ty); 如果是inline,则进入具体网页内容的绘制。网页上面的图片和文字,都是以inline的方式呈现。即图片和文字都必须通过”m_lineBoxes.paint(this, paintInfo, tx, ty);“ 语句,才能够显示在浏览器上面,它决定了网页上面是否能够正常显示图片和文字。 注意:网页上的文字或空格都会创建一个“#text”节点。 文本绘制的函数调用: #3 0x40d0ecb4 in WebCore::GraphicsContext::drawText () from /opt/lib/libQtWebKit.so.4 (开始绘制文字) #4 0x40da44ac in WebCore::paintTextWithShadows () from /opt/lib/libQtWebKit.so.4 #5 0x40da7a24 in WebCore::InlineTextBox::paint () #6 0x40d9ea28 in WebCore::InlineBox::paint () from /opt/lib/libQtWebKit.so.4 #7 0x40da3c1c in WebCore::InlineFlowBox::paint () from /opt/lib/libQtWebKit.so.4 #8 0x40e82184 in WebCore::RootInlineBox::paint () from /opt/lib/libQtWebKit.so.4 #9 0x40e1db34 in WebCore::RenderLineBoxList::paint () from /opt/lib/libQtWebKit.so.4 #10 0x40daccec in WebCore::RenderBlock::paintContents () from /opt/lib/libQtWebKit.so.4 #11 0x40dc1698 in WebCore::RenderBlock::paintObject () from /opt/lib/libQtWebKit.so.4 #12 0x40dac78c in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4
图片绘制的函数调用: #5 0x40d11784 in WebCore::GraphicsContext::drawImage () from /opt/lib/libQtWebKit.so.4 #6 0x40e03570 in WebCore::RenderImage::paintReplaced () from /opt/lib/libQtWebKit.so.4 #7 0x40e3fb54 in WebCore::RenderReplaced::paint () from /opt/lib/libQtWebKit.so.4 #8 0x40d9eb4c in WebCore::InlineBox::paint () from /opt/lib/libQtWebKit.so.4 #9 0x40da3c24 in WebCore::InlineFlowBox::paint () from /opt/lib/libQtWebKit.so.4 #10 0x40e82198 in WebCore::RootInlineBox::paint () from /opt/lib/libQtWebKit.so.4 #11 0x40e1db48 in WebCore::RenderLineBoxList::paint () from /opt/lib/libQtWebKit.so.4 #12 0x40daccb4 in WebCore::RenderBlock::paintContents () from /opt/lib/libQtWebKit.so.4 #13 0x40dc1660 in WebCore::RenderBlock::paintObject () from /opt/lib/libQtWebKit.so.4 #14 0x40dac754 in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4
表单输入控件绘制的函数调用: #6 0x40f2b2c8 in WebCore::RenderThemeQt::paintButton () from /opt/lib/libQtWebKit.so.4 #7 0x40f299a4 in WebCore::RenderThemeQt::paintCheckbox () from /opt/lib/libQtWebKit.so.4 #8 0x40e6feb4 in WebCore::RenderTheme::paint () from /opt/lib/libQtWebKit.so.4 (这里判断表单输入控件的类型,然后调用该类型的绘制函数) #9 0x40dd88a4 in WebCore::RenderBox::paintBoxDecorations () from /opt/lib/libQtWebKit.so.4 #10 0x40dbdb10 in WebCore::RenderBlock::paintObject () from /opt/lib/libQtWebKit.so.4 #11 0x40dac69c in WebCore::RenderBlock::paint () from /opt/lib/libQtWebKit.so.4 总结 元素的绘制,是由默认配置(html4.css)中的display,-webkit-appearance这些css属性来控制其具体的绘制流程。即这些css属性变化,他们的绘制也会发生相应的变化。即我们对一些浏览器问题的处理,是基于某一种css默认配置的处理。所以不要轻易改动css默认配置,尤其是与上面的两条属性有关的样式。
int marginTop() const; int marginBottom() const; int marginLeft() const; int marginRight() const; int paddingTop() const; int paddingBottom() const; int paddingLeft() const; int paddingRight() const; int borderTop() const; int borderBottom() const; int borderLeft() const; int borderRight() const; int marginTop() const; int marginBottom() const; int marginLeft() const; int marginRight() const; int paddingTop() const; int paddingBottom() const; int paddingLeft() const; int paddingRight() const; int borderTop() const; int borderBottom() const; int borderLeft() const; int borderRight() const;
width()和height()方法获得包括边界在内的盒子宽度和高度。
int width() const; int height() const; int width() const; int height() const;
客户盒子(client box)是盒子(box)除边框和滚动条之外但包括填充在内的区域。
int clientLeft() const { return borderLeft(); } int clientTop() const { return borderTop(); } int clientWidth() const; int clientHeight() const; int clientLeft() const { return borderLeft(); } int clientTop() const { return borderTop(); } int clientWidth() const; int clientHeight() const;
int scrollLeft() const; int scrollTop() const; int scrollWidth() const; int scrollHeight() const; int scrollLeft() const; int scrollTop() const; int scrollWidth() const; int scrollHeight() const;
eclipse中使用maven插件的时候,运行run as maven build的时候报错
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
可以设一个环境变量M2_HOME指
1.建好一个专门放置MySQL的目录
/mysql/db数据库目录
/mysql/data数据库数据文件目录
2.配置用户,添加专门的MySQL管理用户
>groupadd mysql ----添加用户组
>useradd -g mysql mysql ----在mysql用户组中添加一个mysql用户
3.配置,生成并安装MySQL
>cmake -D
好久没有去安装过MYSQL,今天自己在安装完MYSQL过后用navicat for mysql去厕测试链接的时候出现了10061的问题,因为的的MYSQL是最新版本为5.6.24,所以下载的文件夹里没有my.ini文件,所以在网上找了很多方法还是没有找到怎么解决问题,最后看到了一篇百度经验里有这个的介绍,按照其步骤也完成了安装,在这里给大家分享下这个链接的地址
import java.io.UnsupportedEncodingException;
/**
* 转换字符串的编码
*/
public class ChangeCharset {
/** 7位ASCII字符,也叫作ISO646-US、Unicode字符集的基本拉丁块 */
public static final Strin
其实这个没啥技术含量,大湿们不要操笑哦,只是做一个简单的记录,简单用了一下递归算法。
import java.io.File;
/**
* @author Perlin
* @date 2014-6-30
*/
public class PrintDirectory {
public static void printDirectory(File f
linux安装mysql出现libs报冲突解决
安装mysql出现
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.33-1.linux2.6.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686
Dear,
I'm pleased to announce that ktap release v0.1, this is the first official
release of ktap project, it is expected that this release is not fully
functional or very stable and we welcome bu