Hi
This is my project proposal. Please do give feedbacks, suggestions on it!!
*Title:*
Improved Inline Element handling for NetSurf
*Abstract:*
Most HTML elements permitted within the BODY are classified as either
block-level elements or inline elements. Inline elements form the key to
formatting the page contents. NetSurf which closely follows the CSS
specifications such as the box model and visual formatting model. Hence my
aim is to improve the inline element support, especially enhancing the
borders, background image, CSS white space support and generating test cases
to the problems that NetSurf currently faces, i.e.
testing how NetSurf behaves and also testing how other standards compliant
browsers behave. (E.g. Firefox, Opera & Safari/Konqueror). And most
important
of all documenting the layout code and the linebreaking code more
explicitly.
IRC nick: manjeet
The entire project proposal is available at:
http://manjeet.chayel.googlepages.com/GSoC_NetSurf.pdf
*Project:*
*I. Introduction:*
My project proposal for SoC 2008 is Improving the Inline element handling in
NetSuf . This is a bit of a mouthful for a project name so I'll begin by
stating
what this multi-syllable contraption is supposed to do:
1.Generating test cases for all the problems that NetSurf currently
exhibits. Which would involve looking at what the specification says,
testing how NetSurf
behaves and also testing how other standards compliant browsers behave. (E.g.
Firefox, Opera & Safari/Konqueror).
2.Updating the code to fix the issues, which I have been able to identify
through my research along with help from NetSurf mentors.
* Inlines with borders are broken and disjointed borders when there is
padding present.
* Background colors for inlines do not fill the area where padding is
present.
* Background image positioning in case of inlines.
*Providing the support for CSS white-spaces (wrapping)
*Unicode line breaking algorithm
3.Doing a postmortem of code, checking for any regressions brought about by
code changes.
4.Documenting the layout and line breaking code more explicitly.
*II. Implementation details and milestones :*
This project obviously is rather ambitious and while it would be
outstanding. I've heard that software development projects can sometimes,
you know, run late or have proposed functionality cut and scaled back. I've
envisioned the implementation plan for this toolkit as a set of independent
stages. The core idea is that completion of each stage produces a project
output that is self-contained, provides significant functionality, and can
be used on its own. I'm a complete believer in iterative development and
early and continuous integration; however the spiral will have to occur
within each stage, at least to the point where the output of that stage has
the features frozen, design and specification nailed
down, and beta quality code released.
*Road map:*
1. Understanding the HTML layout and display code. (layout.c and
html_redraw.c) [ Completed ].
2. Generating test cases for all the problems that NetSurf currently
exhibits. Which would involve looking at what the specification says,
testing how NetSurf
behaves and also testing how other standards compliant browsers
behave. (E.gFirefox, Opera & Safari/Konqueror).
3. Fixing the problem of Inlines with borders, which are broken and
disjointed borders when there is padding present. I have understood from
NetSurf code.
That layout.c and html_redraw.c will be files I will be dealing.
Layout.chas only two entry points layout_document() and
layout_inline_container()
The CSS box model describes the rectangular boxes that are generated for
elements in the document tree and laid out according to the visual
formatting
model. Each box has a content area (e.g., text, an image, etc.) and optional
surrounding padding, border, and margin areas; the size of each area is
specified by
properties defined below
-The margin, border, and padding can be broken down into top, right, bottom,
and left segments
- Each box has four edges inner edge, padding edge, border edge and outer
edge.
Absolutely positioned boxes are constructed in the box tree in the same
place as if they were not absolutely positioned. Inline boxes are created as
INLINE_BLOCK. the background and borders of the element forming the stacking
context. The box tree is then be rendered using each node's coordinates. The
background style of the content, padding, and border areas of a box is
specified by the 'background' property of the generating element. Margin
backgrounds are always transparent. By handling the border details this
issue
can be resolved.
4. Modify the code the width module in layout.c to enable background colors
for inlines where the padding is present by adjusting the width of box. The
box structure has the padding value for that box.
5. Developing the feature to support background image positioning in case of
inlines. Background image position is not correctly supported for inlines.
Sites such as Wikipedia place non-repeating images in the right padding
oflink text. NetSurf currently places the background image at the left hand
side of the inline, under the text. Various test case for this will be
generated and tackled one by one.
6. Providing support for CSS white-space (wrapping of text) .This property
declares how white-space inside the element is handled. Values can b normal
| pre | nowrap | pre-wrap | pre-line | inherit. The white-space processing
will be done as documented in the CSS specifications .(
http://www.w3.org/TR/CSS21/text.html#white-space-prop). This will be done by
understanding the behaviour html_text_decoration() and
html_text_decoration_inline() module in the html_redraw.c. With the logic of
the Unicode line breaking algorithm. As mentioned in the CSS standards.
----
Yours
Manjeet