Commit Graph

1676 Commits

Author SHA1 Message Date
Vincent Sanders
6075feb487 create netsurf inttypes header to have portable integer formatting macros 2017-01-21 14:20:55 +00:00
Vincent Sanders
70d700b26c rationalise use of utils/utils.h header 2017-01-19 21:15:08 +00:00
Vincent Sanders
7dab7cb43d move plot style header to netsurf include directory
move plotter style header and adjust all callers to use only what they
actually require.
2017-01-13 10:03:24 +00:00
Vincent Sanders
a2396edde4 complete transition to locale independant core operation
The netsurf core no longer uses any locale dependant operations
excepting the mall number or cases where such operations are
explicitly wanted.

the netsurf_init now calls setlocale with the empty string and lets
the c library setup as per its specific implementation.

any core functionality that specificaly processes ascii text must use
the utils/ascii.h header to do so.
2016-09-29 22:37:10 +01:00
Michael Drake
7b78ef3361 Style: Fix ignoring of STYLE elements with non-screen media.
We were handling the STYLE tag getting added in the
dom_default_action_DOMSubtreeModified_cb callback, however,
the media attribute dadn't been added by that point.

We now check it in the dom_default_action_DOMNodeInserted_cb
callback, at which time the media attribute is available for
checking.

Note, we should probably store the media type in the
html_stylesheet structure, but for now we just have an
`unused` boolean.

Also, it may be possible to optimise to avoid parsing non-
screen media STYLE element data if we could detect the media
earlier.
2016-09-24 12:44:28 +01:00
Vincent Sanders
c830d14d0b cleanup seevral doxygen warnings 2016-09-13 09:16:31 +01:00
Vincent Sanders
fa5e6fcdf9 make html content line parsing use no locale dependant ascii processing 2016-09-12 22:50:46 +01:00
Vincent Sanders
ca12878c2f use ascii processing when determining form charset 2016-09-12 22:43:39 +01:00
Vincent Sanders
1776a0e61e make box construction use correct ascii processing 2016-09-11 16:42:12 +01:00
Vincent Sanders
6efe60ee1d simplify box_extract_link interface and improve documentation 2016-09-11 12:19:56 +01:00
Michael Drake
a122b94efd URL escape: Simplify to avoid unnecessary allocation.
This removes the toskip parameter, which was only used by the RISC OS
front end.  The toskip param was used to skip 8 characters which did
not need to be escaped from the start of the URL.  The RISC OS front
end now orders the steps of its URL construction to avoid the need
for this.
2016-07-25 09:04:35 +01:00
Vincent Sanders
8066d1c8b4 move key press enums and operations to their own header 2016-07-01 14:27:04 +01:00
Vincent Sanders
66d0f14b32 move the public form API 2016-06-14 12:39:54 +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
667605869f move plotters header into public API 2016-05-30 21:05:57 +01:00
Vincent Sanders
7fc0a4c481 move desktop window header into public API 2016-05-30 17:32:57 +01:00
Vincent Sanders
8711fbe47d move mouse and pointer state header into public API 2016-05-30 12:10:08 +01:00
Vincent Sanders
9ce71876ce move layout header into public API 2016-05-30 11:31:35 +01:00
Vincent Sanders
fe7eb85614 move misc header into public API 2016-05-30 11:23:32 +01:00
Vincent Sanders
aa5090c85b move utf8 header into public API 2016-05-30 11:20:15 +01:00
Vincent Sanders
903c4dbef9 move search header into public API 2016-05-30 10:57:22 +01:00
Vincent Sanders
2dab078f21 move bitmap API header to core include directory 2016-05-26 23:01:03 +01:00
Vincent Sanders
6722943b81 move the CSS content handler 2016-05-26 11:18:41 +01:00
Vincent Sanders
3224d7121a move image content handlers to accomodate core build changes 2016-05-23 23:32:16 +01:00
Vincent Sanders
d6b6dafe50 fix plain text render regression introduced in layout table changes 2016-04-28 10:50:13 +01:00
Vincent Sanders
6a36d4ec2b remove all core usage of warn_user API 2016-04-26 12:50:16 +01:00
Vincent Sanders
69cea38f41 update scrollbar_create error handling to return nserror 2016-04-26 12:14:56 +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
Vincent Sanders
7d9c9dba36 Split utils header into string functions and everything else
split out the string handling API from the rest of the utils header
and fix up all the fallout.
2016-04-21 22:36:21 +01:00
Vincent Sanders
ea08caccb9 implement tsla code review points in render monotonic time change 2016-04-20 19:57:44 +01:00
Vincent Sanders
a6dd92c571 use monotonic clock call for html reflow timing 2016-04-20 19:18:15 +01:00
Vincent Sanders
dee7426656 stop content header dragging in so many other headers 2016-04-19 23:20:29 +01:00
Vincent Sanders
33c7df0c40 complete the rename of the gui browser table
When the operations tables were created the browser table was renamed
to miscellaneous except the actual rename patch was never applied,
this fixes that situation.
2016-04-16 23:50:21 +01:00
Vincent Sanders
d15ab96a51 Fix size_t printf formatting
The printf formatting for size_t is set in c99 as %zu but in windows
it is %Iu this is solved by adding and inttypes style PRI macro for size_t

This also uses this macro everywhere size_t is formatted.
2016-03-17 22:00:54 +00:00
Vincent Sanders
7d4d500c1d Revert "Fix memory leak in error handling"
This reverts commit c53be10892.

Issue tracked in bug 2443
2016-03-16 08:36:36 +00:00
Vincent Sanders
c53be10892 Fix memory leak in error handling
error handling during form gadget construction could leak, this fixes
the leak on error. Fixes coverity CID 1109875
2016-03-14 15:54:10 +00:00
Vincent Sanders
1ace8538d1 Fix possible dereference of NULL
The return of calloc was not being checked and could have lead to a
NULL pointer dereference. This fixes coverity CID 1316337

Additionally the functions documentation comments were cleaned up.
2016-03-14 14:19:43 +00:00
Michael Drake
04e61b710f Fix object accounting for aborted HTML contents. 2016-02-11 11:45:38 +00:00
Michael Drake
d4a01d525a HTML: Remove some status bar updating code. 2016-02-10 16:09:16 +00:00
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
8e580ccd19 Split out presentational hints handling. 2016-02-05 10:49:58 +00:00
Michael Drake
b002ba7357 Simplify special element handling in node inserted callback. 2016-01-29 16:04:47 +00:00
Michael Drake
b58176c65e Spaces to tabs. 2016-01-29 16:04:47 +00:00
Michael Drake
d9e92d2032 Add comment on on-demand JS context creation safety
Checking for enable_scripting isn't needed here.
2016-01-21 14:58:38 +00:00
Michael Drake
82b298ac2c Ensure we do on-demand JS context creation only when JS is enabled.
An alternative approach which may be better would be to create the
JavaScript context when the html_content is created, rather than
on demand.

This code checks for the JS context and creates one every time we
add a node to the DOM.  So when JS is on, every doc with a single
node in it has a JS context.  This seems to make on-demand creation
a redundant overhead.
2016-01-21 14:51:17 +00:00
Michael Drake
669448d7b6 Fix place where we're calling a js_* fn without checking for context. 2016-01-21 14:49:57 +00:00
Michael Drake
594012ef52 Ensure constant javascript_enabled for HTML contents.
Now we take the value of the javascript_enabled option when the
content is created.  We then use the content's script_enabled
boolean everywhere else.

This prevents us getting inconsistent values for javascript_enabled
if a user toggles the setting while a page is loading.

It was read frequently during box construction, and also the
parser's script enabled setting could change where we handled
a change of encoding.

Now we only care about the setting of the javascript_enabled
option at time of html_content creation.
2016-01-21 14:11:36 +00:00
Michael Drake
3dcf7d80a1 Pass html_content to box_extract_link. 2016-01-21 14:09:57 +00:00
Michael Drake
ad273a41e8 Simplify place_float_below loop condition. 2016-01-21 09:44:05 +00:00