What do internet browsers use for rendering?
Asked Answered
P

2

7

very quick one, I was always wondering, do internet browsers use for rendering OS API functions to create buttons, render mages and so, or do they render it all on their own?

I first thoght that it uses system api, but there are some effects like when screen fades into grey and you see only small window in the middle, you know, thet effect used on many picture albums online, which I dont really how to achive using for example only Win32 calls.

EDIT: To be more exact, I know that final drawing on screen will always use system API, but you can send prerendered image as you want to it. Thanks.

Purveyor answered 28/8, 2010 at 13:25 Comment(3)
(reference) Wikipedia: Web browser enginesPendant
I don't understand the question: yes, final drawing on screen will always use system API. Yes, there's browser-implementation-specific code inside the implementation of each browser, which uses system APIs to render whatever the browser wants to render. So what's the question?Gratulation
Well, maybe better formulation would be: Do browser rendering engines useOs api for creating buttons, writing text, creating boxes, etc., or do they render all of this on their own using OS API just for actually show the rendered image on the screen? Becouse, the whole rendering of text, graphics and so seems pretty hard to write completely yourself.....Purveyor
R
6

Web browsers use their own rendering engines rather than OS API. Using OS API to render buttons totally depends on the design decision of a particular rendering engine. However, to run on various operating systems these engines prefer their own rendering to offer same look-n-feel across platforms.

  • Gecko, for Firefox
  • Trident, for Internet Explorer
  • Presto, for Opera
  • KHTML, for Konqueror
  • WebKit, for Apple's Safari and Google's Chrome web browsers.

Ref: http://en.wikipedia.org/wiki/Web_browser_engine

Rufford answered 28/8, 2010 at 13:31 Comment(1)
Thanks, if I can be more specific, for example, do any of these engines use some GUI APIs? For example for drawing text? Or does even that handled completely by drawing engine?Purveyor
G
2

Do browser rendering engines useOs api for creating buttons, writing text, creating boxes, etc., or do they render all of this on their own using OS API just for actually show the rendered image on the screen?

I implemented something of a browser rendering engine (see e.g. Table of Supported Elements and Supported Properties for a list of the HTML elements and CSS properties that it supports).

I use system APIs (.NET Framework APIs, which are thin wrappers around underlying O/S GDI APIs) to:

  • Measure words (strings of text)
  • Paint words
  • Draw lines and boxes
  • Fill rectangles with solid color

These are the kind of API functionality that's implemented by the Windows GDI.

There are also some system (O/S or .NET) APIs that I use, to draw buttons and combo boxes (see Rewrite standard controls like edit, combo, etc?).

Becouse, the whole rendering of text, graphics and so seems pretty hard to write completely yourself

Yes, implementing CSS and everything does take a while. You've seen how long it took the browser developer teams to implement: several calendar years, many person-years.

Gratulation answered 28/8, 2010 at 21:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.