Commit Graph

457 Commits

Author SHA1 Message Date
Michael Drake
3c3685eb96 Layout: Percentage max-width constrained boxes don't affect min on minmax pass. 2018-04-02 20:25:19 +01:00
Michael Drake
473a40bc11 Layout: Fix min max pass calc that looked wrong.
The `width` variable call be set to AUTO, which is INT_MIN,
so we can't add it to max without checking it's > 0, or we'll
blunder into the minmax assertions.
2018-04-02 20:23:30 +01:00
Michael Drake
af554fcedf Layout: Remove some commented out code. 2018-04-02 20:22:49 +01:00
Michael Drake
c03405b3b3 Layout: Reduce code duplication in handling of box side properties. 2018-01-12 17:55:01 +00:00
Michael Drake
6be6fa1b21 CSS utils: Handle new units in length conversion routines.
This causes a ripple effect of all the callsites needing
information they didn't have.
2018-01-05 13:49:51 +00:00
Michael Drake
a67973f312 Layout: No need to expose layout_calculate_descendant_bboxes(). 2018-01-05 13:49:51 +00:00
Michael Drake
ae286be5a9 Layout: No need to expose layout_inline_container(). 2018-01-05 13:49:51 +00:00
Michael Drake
cf3eba081a Layout: No need to expose layout_minmax_table(). 2018-01-05 13:49:51 +00:00
Michael Drake
f7f18042bf CSS: Wrappers for computed style getters that return unsupported values.
We don't yet handle the Flexbox-related values for certain properties.
2017-10-20 17:46:37 +01:00
Vincent Sanders
f89f7192ef fix size+t formatting in logging 2017-09-07 21:08:02 +01:00
Vincent Sanders
86c3f3e005 update layout logging to use a catagory 2017-09-07 18:26:53 +01:00
Vincent Sanders
75018632a9 Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done

@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 18:45:27 +01:00
Michael Drake
f855774e1a Layout: Prevent negative widths on absolutle positioned boxes. 2017-06-02 18:24:23 +01:00
Michael Drake
6f7b5e3f22 Layout: Fix auto margins to be affected by {min|max}-width constraints. 2017-04-28 15:44:34 +01:00
Michael Drake
6c726473ef Layout: Implement CSS3 box-sizing property.
Updates user agent CSS to set form element box-sizing properties,
and removes some legacy pre-CSS3 hacks for handling gadget dimensions.
2017-04-27 16:47:38 +01:00
Vincent Sanders
8861923455 Allow include directories to be added by sub makefiles 2016-06-06 14:47:27 +01:00
Vincent Sanders
76a68d7dd0 Update content to split public and internal API 2016-06-06 09:01:38 +01:00
Vincent Sanders
7fc0a4c481 move desktop window header into public API 2016-05-30 17:32:57 +01:00
Vincent Sanders
9ce71876ce move layout header into public API 2016-05-30 11:31:35 +01:00
Vincent Sanders
6722943b81 move the CSS content handler 2016-05-26 11:18:41 +01:00
Vincent Sanders
974a4a21e1 split out the layout glyph sizing and splitting API
This refactors the core "font" sizing API to be handled through gui
 function tables similar to every other core/frontend calling API.
2016-04-23 23:32:21 +01:00
Michael Drake
ad273a41e8 Simplify place_float_below loop condition. 2016-01-21 09:44:05 +00:00
Michael Drake
a774e9473d Make use of cached place float below value earlier. 2016-01-20 22:37:22 +00:00
Michael Drake
0bbc03c577 Cache place below level, to avoid pointless calls to find_sides. 2016-01-20 20:09:40 +00:00
Michael Drake
c13080d96c Optimise white hot find_sides to take advantage of sorted float_children.
Now we have an early exit when we get to the floats above the area we're
interested in.
2016-01-20 20:02:56 +00:00
Michael Drake
948a93041d Sort float_children of containers by their bottom edge. 2016-01-20 20:02:56 +00:00
Michael Drake
38e6fd1b74 Split adding float to a container out into separate function. 2016-01-20 20:02:55 +00:00
Michael Drake
018adc2f5e Remove redundant condition in white hot path. 2016-01-20 18:27:15 +00:00
Michael Drake
e5a2538b6d Make it clearer why we're asserting. 2015-11-11 22:22:19 +00:00
Michael Drake
ed5fd91843 Fix overflow-{x|y} handling. 2015-11-01 14:06:06 +00:00
Michael Drake
7a6f0c765a Fix descendant bounding box calcs to work with overflow-{x|y}. 2015-10-31 19:11:24 +00:00
Michael Drake
257666499d Reorder percentage calculation.
Fixed point representation couldn't store 0.65 exactly, so avoid doing
the divide by 100 first.

I will look at moving this into libcss's fixed point header and doing
it in a way that avoids arithmetic overflow, but for now this fixes
el reg layout.
2015-08-24 22:47:58 +01:00
Vincent Sanders
c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00
Michael Drake
69776768d2 Remove duplicate branch in relative position handling. 2015-04-23 09:46:04 +01:00
Vincent Sanders
79e501075a make the form select menu API smaller.
By hiding all but the form selection menu option structure from code
outside of render this reduces the API to the absolute minimum to
support this feature.
2014-11-13 21:52:08 +00:00
Vincent Sanders
e8277f2954 doxgen warning fixes in riscos frontend. 2014-11-12 22:36:11 +00:00
Vincent Sanders
1097cc40b4 remove unecessary browser.h include from core headers 2014-10-17 12:21:52 +01:00
Vincent Sanders
17be8cf216 Put the font operations table alongside all the other core API
The netsurf core is driven from numerous operation tables most of
which are now set through a common netsurf_register() interface. The
font and plotting interfaces are currently separate and unlike all the
other operation tables are modified for differing contexts.

This change moves the font operations alongside all the other
operations table and remove unnecessary interaction with the renderers
font internals. Further this also removes the need for css internals
to be visible in frontends.
2014-10-13 11:56:31 +01:00
Michael Drake
2cf3525b00 Fix text selection.
Values returned by nscss_len2px are actually libcss fixed-points,
so convert the result to pixels. Also reduce the amount by which
the top of descendant bboxes are extended to 3/4 of the text
height, which is the maximum possible amount that the text can
protrude above the box when line-height is reduced.
2014-08-20 11:08:35 +01:00
Michael Drake
2ea5ca5805 Remove unwanted debug. 2014-08-04 14:59:13 +01:00
Michael Drake
a807d762f9 mailto urls don't have passwords or ports, so we don't need to look for ':'. 2014-08-04 14:49:35 +01:00
Michael Drake
779deb8559 Fix overflow handling issue. 2014-07-13 18:21:50 +01:00
Michael Drake
0d3faeb4bd Allow suppression of style dump in box tree dumps. 2014-07-13 18:07:12 +01:00
Michael Drake
5085bfbf99 Handle overflow-x and overflow-y properties.
Fixes display of BBC Sport.
  Requires LibCSS with support for overflow-x and overflow-y.
2014-06-01 18:36:22 +01:00
Michael Drake
8b253a2151 Improve min/max-height handling on replaced elements. 2014-01-04 14:02:22 +00:00
Vincent Sanders
c26dd43669 ensure no division by zero in scaled object dimensioning (coverity 1109864 ) 2013-11-03 21:52:01 +00:00
Michael Drake
0bbaf1d24d Layout doesn't need to handle the old insane textarea box splitting now. Fixes Coverity:1109882. 2013-10-23 12:48:16 +01:00
Michael Drake
8d3a89b62d Don't attempt to vertical-align objects for now, as our current bodged vertical-align implementation can do more harm than good. 2013-07-12 11:34:47 +01:00
Michael Drake
431f9fde5f Apply vertical alignment to objects on line. 2013-06-08 10:42:33 +01:00
Vincent Sanders
ee6e6eec05 move options include 2013-05-28 14:16:10 +01:00