⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 renderblock.h

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 H
📖 第 1 页 / 共 2 页
字号:
    virtual void childBecameNonInline(RenderObject* child);    virtual void setSelectionState(SelectionState s);    virtual IntRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool /*clipToVisibleContent*/)    {        return selectionGapRectsForRepaint(repaintContainer);    }    GapRects selectionGapRectsForRepaint(RenderBoxModelObject* repaintContainer);    virtual bool shouldPaintSelectionGaps() const;    bool isSelectionRoot() const;    GapRects fillSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,                               int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* = 0);    GapRects fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,                                     int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);    GapRects fillBlockSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,                                    int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);    IntRect fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight, int bottomY, RenderBlock* rootBlock,                                     int blockX, int blockY, const PaintInfo*);    IntRect fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock,                                  int blockX, int blockY, int tx, int ty, const PaintInfo*);    IntRect fillRightSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock,                                  int blockX, int blockY, int tx, int ty, const PaintInfo*);    IntRect fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height, const PaintInfo*);    void getHorizontalSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);    int leftSelectionOffset(RenderBlock* rootBlock, int y);    int rightSelectionOffset(RenderBlock* rootBlock, int y);    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);    virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true);    // Helper methods for computing line counts and heights for line counts.    RootInlineBox* lineAtIndex(int);    int lineCount();    int heightForLineCount(int);    void clearTruncation();    int desiredColumnWidth() const;    unsigned desiredColumnCount() const;    Vector<IntRect>* columnRects() const;    void setDesiredColumnCountAndWidth(int count, int width);    int columnGap() const;        void adjustRectForColumns(IntRect&) const;    void addContinuationWithOutline(RenderInline*);    void paintContinuationOutlines(PaintInfo&, int tx, int ty);    RenderInline* inlineContinuation() const { return m_inlineContinuation; }    void setInlineContinuation(RenderInline* c) { m_inlineContinuation = c; }    virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);    virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);    // This function is a convenience helper for creating an anonymous block that inherits its    // style from this RenderBlock.    RenderBlock* createAnonymousBlock() const;private:    void adjustPointToColumnContents(IntPoint&) const;    void adjustForBorderFit(int x, int& left, int& right) const; // Helper function for borderFitAdjust    void markLinesDirtyInVerticalRange(int top, int bottom);protected:    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);    void newLine(EClear);    virtual bool hasLineIfEmpty() const;    bool layoutOnlyPositionedObjects();    virtual RootInlineBox* createRootBox(); // Subclassed by SVG.    private:    Position positionForBox(InlineBox*, bool start = true) const;    Position positionForRenderer(RenderObject*, bool start = true) const;    // Adjust tx and ty from painting offsets to the local coords of this renderer    void offsetForContents(int& tx, int& ty) const;    void calcColumnWidth();    int layoutColumns(int endOfContent = -1);    bool expandsToEncloseOverhangingFloats() const;protected:    struct FloatingObject {        enum Type {            FloatLeft,            FloatRight        };        FloatingObject(Type type)            : m_renderer(0)            , m_top(0)            , m_bottom(0)            , m_left(0)            , m_width(0)            , m_type(type)            , m_shouldPaint(true)            , m_isDescendant(false)        {        }        Type type() { return static_cast<Type>(m_type); }        RenderBox* m_renderer;        int m_top;        int m_bottom;        int m_left;        int m_width;        unsigned m_type : 1; // Type (left or right aligned)        bool m_shouldPaint : 1;        bool m_isDescendant : 1;    };    class MarginInfo {        // Collapsing flags for whether we can collapse our margins with our children's margins.        bool m_canCollapseWithChildren : 1;        bool m_canCollapseTopWithChildren : 1;        bool m_canCollapseBottomWithChildren : 1;        // Whether or not we are a quirky container, i.e., do we collapse away top and bottom        // margins in our container.  Table cells and the body are the common examples. We        // also have a custom style property for Safari RSS to deal with TypePad blog articles.        bool m_quirkContainer : 1;        // This flag tracks whether we are still looking at child margins that can all collapse together at the beginning of a block.          // They may or may not collapse with the top margin of the block (|m_canCollapseTopWithChildren| tells us that), but they will        // always be collapsing with one another.  This variable can remain set to true through multiple iterations         // as long as we keep encountering self-collapsing blocks.        bool m_atTopOfBlock : 1;        // This flag is set when we know we're examining bottom margins and we know we're at the bottom of the block.        bool m_atBottomOfBlock : 1;        // If our last normal flow child was a self-collapsing block that cleared a float,        // we track it in this variable.        bool m_selfCollapsingBlockClearedFloat : 1;        // These variables are used to detect quirky margins that we need to collapse away (in table cells        // and in the body element).        bool m_topQuirk : 1;        bool m_bottomQuirk : 1;        bool m_determinedTopQuirk : 1;        // These flags track the previous maximal positive and negative margins.        int m_posMargin;        int m_negMargin;    public:        MarginInfo(RenderBlock* b, int top, int bottom);        void setAtTopOfBlock(bool b) { m_atTopOfBlock = b; }        void setAtBottomOfBlock(bool b) { m_atBottomOfBlock = b; }        void clearMargin() { m_posMargin = m_negMargin = 0; }        void setSelfCollapsingBlockClearedFloat(bool b) { m_selfCollapsingBlockClearedFloat = b; }        void setTopQuirk(bool b) { m_topQuirk = b; }        void setBottomQuirk(bool b) { m_bottomQuirk = b; }        void setDeterminedTopQuirk(bool b) { m_determinedTopQuirk = b; }        void setPosMargin(int p) { m_posMargin = p; }        void setNegMargin(int n) { m_negMargin = n; }        void setPosMarginIfLarger(int p) { if (p > m_posMargin) m_posMargin = p; }        void setNegMarginIfLarger(int n) { if (n > m_negMargin) m_negMargin = n; }        void setMargin(int p, int n) { m_posMargin = p; m_negMargin = n; }        bool atTopOfBlock() const { return m_atTopOfBlock; }        bool canCollapseWithTop() const { return m_atTopOfBlock && m_canCollapseTopWithChildren; }        bool canCollapseWithBottom() const { return m_atBottomOfBlock && m_canCollapseBottomWithChildren; }        bool canCollapseTopWithChildren() const { return m_canCollapseTopWithChildren; }        bool canCollapseBottomWithChildren() const { return m_canCollapseBottomWithChildren; }        bool selfCollapsingBlockClearedFloat() const { return m_selfCollapsingBlockClearedFloat; }        bool quirkContainer() const { return m_quirkContainer; }        bool determinedTopQuirk() const { return m_determinedTopQuirk; }        bool topQuirk() const { return m_topQuirk; }        bool bottomQuirk() const { return m_bottomQuirk; }        int posMargin() const { return m_posMargin; }        int negMargin() const { return m_negMargin; }        int margin() const { return m_posMargin - m_negMargin; }    };    void adjustPositionedBlock(RenderBox* child, const MarginInfo&);    void adjustFloatingBlock(const MarginInfo&);    RenderBox* handleSpecialChild(RenderBox* child, const MarginInfo&, bool& handled);    RenderBox* handleFloatingChild(RenderBox* child, const MarginInfo&, bool& handled);    RenderBox* handlePositionedChild(RenderBox* child, const MarginInfo&, bool& handled);    RenderBox* handleRunInChild(RenderBox* child, bool& handled);    int collapseMargins(RenderBox* child, MarginInfo&);    int clearFloatsIfNeeded(RenderBox* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin, int yPos);    int estimateVerticalPosition(RenderBox* child, const MarginInfo&);    void determineHorizontalPosition(RenderBox* child);    void handleBottomOfBlock(int top, int bottom, MarginInfo&);    void setCollapsedBottomMargin(const MarginInfo&);    // End helper functions and structs used by layoutBlockChildren.private:    typedef ListHashSet<RenderBox*>::const_iterator Iterator;    DeprecatedPtrList<FloatingObject>* m_floatingObjects;    ListHashSet<RenderBox*>* m_positionedObjects;    // An inline can be split with blocks occurring in between the inline content.    // When this occurs we need a pointer to our next object.  We can basically be    // split into a sequence of inlines and blocks.  The continuation will either be    // an anonymous block (that houses other blocks) or it will be an inline flow.    RenderInline* m_inlineContinuation;    // Allocated only when some of these fields have non-default values    struct MaxMargin {        MaxMargin(const RenderBlock* o)             : m_topPos(topPosDefault(o))            , m_topNeg(topNegDefault(o))            , m_bottomPos(bottomPosDefault(o))            , m_bottomNeg(bottomNegDefault(o))        {         }        static int topPosDefault(const RenderBlock* o) { return o->marginTop() > 0 ? o->marginTop() : 0; }        static int topNegDefault(const RenderBlock* o) { return o->marginTop() < 0 ? -o->marginTop() : 0; }        static int bottomPosDefault(const RenderBlock* o) { return o->marginBottom() > 0 ? o->marginBottom() : 0; }        static int bottomNegDefault(const RenderBlock* o) { return o->marginBottom() < 0 ? -o->marginBottom() : 0; }        int m_topPos;        int m_topNeg;        int m_bottomPos;        int m_bottomNeg;     };    MaxMargin* m_maxMargin;protected:    RenderObjectChildList m_children;    RenderLineBoxList m_lineBoxes;   // All of the root line boxes created for this block flow.  For example, <div>Hello<br>world.</div> will have two total lines for the <div>.    // How much content overflows out of our block vertically or horizontally.    int m_overflowHeight;    int m_overflowWidth;    int m_overflowLeft;    int m_overflowTop;        mutable int m_lineHeight;};inline RenderBlock* toRenderBlock(RenderObject* o){     ASSERT(!o || o->isRenderBlock());    return static_cast<RenderBlock*>(o);}inline const RenderBlock* toRenderBlock(const RenderObject* o){     ASSERT(!o || o->isRenderBlock());    return static_cast<const RenderBlock*>(o);}// This will catch anyone doing an unnecessary cast.void toRenderBlock(const RenderBlock* o);} // namespace WebCore#endif // RenderBlock_h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -