Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why browsers are bloated

Name: Anonymous 2014-07-27 0:20

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/Scrollbar.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Let's reinvent the fucking scrollbar, which every goddamn platform with a UI already has, and make it behave subtly different from the native one!

Right-click a native scrollbar in some other app:
- Scroll Here
- Top
- Bottom
- Page Up
- Page Down
- Scroll Up
- Scroll Down

Right-click a scrollbar in Chrome:
- Back
- Forward
- Reload
- Save As...
...

Right-click a scrollbar in Firefox and Opera:
Absolutely fucking nothing happens!

What the fuck!? How did these terminally retarded idiots get involved in creating one of the most important pieces of software to the average user?

Name: Cudder !MhMRSATORI 2014-09-05 11:50

This page, which has grown since the last time I benchmarked it (>>123), now takes just under 10ms.

>>134
memcpy() is superior.

>>135
If you can't do the absolutely trivial arithmetic needed for determining the right lengths ("maths is hard!") you should not be doing any programming at all.

>>140
For my use the best option is probably null-delimited with prefix-length, i.e.

char *to_nstr(char *str) {
long sl = strlen(str);
char *t = malloc(sizeof(long) + sl + 1);
if(t) {
*((long*)t) = sl;
memcpy(t+sizeof(long), str, sl + 1);
t += sizeof(long);
}
return t;
}


Read-only-compatible with existing C APIs, but contains a length that can be used by functions aware of it.

Newer Posts