Commit Graph

169 Commits

Author SHA1 Message Date
Michael Drake
3bee7b7e12 Layout: Don't generate :before and :after boxes for replaced elements.
In CSS 2.1 this was undefined.

  CSS 2.1 -- 12.1 The :before and :after pseudo-elements

    Note. This specification does not fully define the interaction
    of :before and :after with replaced elements (such as IMG in HTML).
    This will be defined in more detail in a future specification.

    -- https://www.w3.org/TR/CSS21/generate.html#before-after-content

In CSS 3 the :before and :after generated content boxes are not allowed
on replaced elements.

  CSS 3 Generated and Replaced Content Module
        12. Replaced content

  The box model defines different rules for the layout of replaced
  elements than normal elements. Replaced elements do not have
  '::before' and '::after' pseudo-elements; the 'content' property
  in the case of replaced content replaces the entire contents of
  the element's box.

  -- https://www.w3.org/TR/css3-content/#replacedContent
2016-02-09 16:42:28 +00:00
Michael Drake
3dcf7d80a1 Pass html_content to box_extract_link. 2016-01-21 14:09:57 +00:00
Michael Drake
0bbc03c577 Cache place below level, to avoid pointless calls to find_sides. 2016-01-20 20:09:40 +00:00
Vincent Sanders
ad343eccb1 remove unecessary utils/types.h
This cleans up this header and moves the functionality into more
useful places while reducing the include complexity but only pulling
in whats required.
2014-11-02 20:10:32 +00:00
Michael Drake
0d3faeb4bd Allow suppression of style dump in box tree dumps. 2014-07-13 18:07:12 +01:00
Michael Drake
72510f550b Use corestrings in box construction. 2014-01-24 18:58:12 +00:00
Michael Drake
e4c50bd58a Update for new libcss API. 2013-12-13 20:25:08 +00:00
John-Mark Bell
97978e858b Use custom fetcher for inline CSS 2013-02-27 03:11:10 +00:00
Vincent Sanders
31c9ffb4b5 make boxes keep reference to the DOM node that causes them 2012-11-30 12:29:54 +00:00
Vincent Sanders
fb13fcf166 Improve html renderer error reporting 2012-11-26 18:59:13 +00:00
Michael Drake
afdf72d7b5 Confine box_at_point to the document it's given. Callers are now responsible for calling whatever functionality for object boxes. Remove last bw dereference from render directory. Remove a couple of unused functions. 2012-08-21 15:27:52 +01:00
Michael Drake
c3f9e3d3ce Don't need to include browser.h. 2012-08-14 14:53:48 +01:00
Vincent Sanders
25cdea3351 doxygen serious warning cleanup 2012-07-24 16:19:49 +01:00
Michael Drake
71325ca6d0 Bring comment into line with use of libdom instead of libxml.
svn path=/trunk/netsurf/; revision=13718
2012-03-26 10:47:54 +00:00
Michael Drake
d5a2701b38 Don't need libxml.h in render/box.h now.
svn path=/trunk/netsurf/; revision=13717
2012-03-26 10:45:44 +00:00
Daniel Silverstone
6162b49875 Forward decl of struct dom_node to shush things
svn path=/trunk/netsurf/; revision=13666
2012-03-25 10:21:37 +00:00
John Mark Bell
2b215a8df1 Initialise/finalise box constructor string constants
svn path=/trunk/netsurf/; revision=13653
2012-03-25 08:37:48 +00:00
John Mark Bell
682eba9a56 Port box construction to libdom
svn path=/trunk/netsurf/; revision=13608
2012-03-24 18:47:51 +00:00
Michael Drake
ab45ecd228 Use lwc_string for box->id.
svn path=/trunk/netsurf/; revision=13093
2011-10-29 11:37:05 +00:00
John Mark Bell
8e0015798c Remove unused API
svn path=/trunk/netsurf/; revision=12941
2011-10-03 22:02:33 +00:00
Michael Drake
898b01e721 More conversion to nsurl. (box->href, object params, imagemaps, (i)frames)
svn path=/trunk/netsurf/; revision=12933
2011-10-03 20:28:29 +00:00
John Mark Bell
74395ac888 Restartable box tree constructor. Yield between elements.
svn path=/trunk/netsurf/; revision=12912
2011-09-29 19:15:54 +00:00
Michael Drake
6e3e168d08 Avoid instance of using bw->current_content outside desktop/.
svn path=/trunk/netsurf/; revision=12690
2011-08-31 17:53:40 +00:00
Michael Drake
b57c2e0bee Move rectangle type to utils/types.h
svn path=/trunk/netsurf/; revision=12525
2011-06-28 15:18:48 +00:00
Michael Drake
c9fe1b604e HTML contents manage box scrollbars, rather than browser_windows.
svn path=/trunk/netsurf/; revision=12519
2011-06-27 22:21:15 +00:00
Michael Drake
53f4da3420 First pass at core iframes. Currently lacking scrollbars.
svn path=/trunk/netsurf/; revision=12474
2011-06-14 20:00:18 +00:00
Michael Drake
ac447fc293 s/scroll/scrollbar/ and improve scrollbar widget comments.
svn path=/trunk/netsurf/; revision=12363
2011-05-09 22:49:17 +00:00
John Mark Bell
e71691bae8 Merge branches/jmb/content-factory to trunk
svn path=/trunk/netsurf/; revision=12283
2011-05-06 20:40:09 +00:00
Michael Drake
1304964f92 Reduce number of page reflows and viewport
redraws as images are fetched:
+ Flag known-sized boxes generated by images.
+ Treat them as replaced all through layout.
+ Only reflow the document for fetched images
  if we don't already have the box at the
  right size.

svn path=/trunk/netsurf/; revision=12243
2011-04-27 13:50:49 +00:00
Michael Drake
769011911c Optimise first pass of layout. Reduces number of nsfont_width calls by up to the page's word count.
svn path=/trunk/netsurf/; revision=12239
2011-04-26 15:03:44 +00:00
Michael Drake
8d2bb4bd3a Change how blocks are positioned vertically (esp. margin handling).
svn path=/trunk/netsurf/; revision=12235
2011-04-22 21:57:18 +00:00
Michael Drake
a0d7e79c8c Allow box margins to collapse through zero-height boxes.
svn path=/trunk/netsurf/; revision=11981
2011-03-12 18:44:43 +00:00
Daniel Silverstone
68e12d28f9 Remove pointless nasty skanky broken box tree duplication from hell
svn path=/trunk/netsurf/; revision=11970
2011-03-12 16:18:18 +00:00
Michael Drake
9be22ab590 Make sure the last clone box for a wrapped text is properly measuered.
svn path=/trunk/netsurf/; revision=11920
2011-03-05 22:18:06 +00:00
Michael Drake
9e1916ad61 Fix comment.
svn path=/trunk/netsurf/; revision=11891
2011-03-02 19:36:13 +00:00
Michael Drake
3e7ea29e4b Move clone to box flags.
svn path=/trunk/netsurf/; revision=11890
2011-03-02 19:30:08 +00:00
Michael Drake
be366b0e6b Move strip_leading_newline to box flags.
svn path=/trunk/netsurf/; revision=11889
2011-03-02 19:16:03 +00:00
Michael Drake
3707be6292 Move printed to box flags.
svn path=/trunk/netsurf/; revision=11888
2011-03-02 18:41:17 +00:00
Michael Drake
77f67bccb6 Move style_owned to box flags.
svn path=/trunk/netsurf/; revision=11887
2011-03-02 18:27:41 +00:00
Michael Drake
f744c9dfa0 Make box flags and move new line indicator to it.
svn path=/trunk/netsurf/; revision=11886
2011-03-02 17:50:51 +00:00
Michael Drake
e3f00b8546 Cache space widths.
svn path=/trunk/netsurf/; revision=11877
2011-03-01 20:00:41 +00:00
John Mark Bell
d9280e8d72 Fix bug #2076786: do not apply fallback content to failed objects
svn path=/trunk/netsurf/; revision=11797
2011-02-25 19:14:38 +00:00
Michael Drake
27b6096dcd Move stuct rect out of box.h and tree.c.
svn path=/trunk/netsurf/; revision=11647
2011-02-11 19:35:16 +00:00
John Mark Bell
5d27aa256f Port to latest libcss
svn path=/trunk/netsurf/; revision=11526
2011-01-29 19:22:12 +00:00
Daniel Silverstone
cd72933201 Ensure we free more of the css stuff for the box model.
svn path=/trunk/netsurf/; revision=11399
2011-01-19 21:15:23 +00:00
Michael Drake
08ed4c207f Update to new libcss API for simultanious selection for base element and its pseudo elements.
svn path=/trunk/netsurf/; revision=11215
2011-01-05 19:36:05 +00:00
Michael Drake
b010a25771 + Refactor input handling from browser window code into content
handlers.
+ Disentangle all box tree manipulation from browser window
  code and put it where it belongs.
+ Move other content specific and other irrelevant code from
  browser window handling to appropriate places.
+ Put mouse state enum in new mouse header, since it's not just
  used by browser window code, and it is used by treeview
  windows on the treeview branch.

svn path=/trunk/netsurf/; revision=10561
2010-06-04 09:35:08 +00:00
John Mark Bell
000e6ad3de It turns out that realloc(ptr, 0) --> free(ptr) is not actually required by the C standard (whereas realloc(NULL, size) --> malloc(size) is).
Therefore, explicitly model the behaviour expected by our libraries (that realloc of 0 size is equivalent to free).

svn path=/trunk/netsurf/; revision=10524
2010-04-30 07:00:58 +00:00
Daniel Silverstone
30e0cfe7a9 First step to fixing memory leaks -- Box model no longer leaks computed styles
svn path=/trunk/netsurf/; revision=10500
2010-04-27 21:38:41 +00:00
Daniel Silverstone
270ef59a98 Merge jmb/new-cache; r=dsilvers,rs=vince
svn path=/trunk/netsurf/; revision=10180
2010-03-28 12:56:39 +00:00