This allows the decoder to fail gracefully when reading a partial or
malformed TBSCertificate. We also now ensure that the certificate data
is valid before making a copy of it.
I broke this when moving from a xib file to creating the UI in code.
https://developer.apple.com/documentation/appkit/nsuserinterfaceitemidentification/1396829-identifier
says:
"Identifiers are used during window restoration operations to uniquely
identify the windows of the application. [...] If you create an item in
Interface Builder and do not set a value for this string, a unique value
is created for the item when the nib file is loaded. For
programmatically created views, you typically set this value after
creating the item but before adding it to a window."
Without this, encodeRestorableStateWithCoder: / restoreStateWithCoder:
in MacPDFView weren't getting called.
The documentation is very loud about cell-based things being
deprecated, but it's fairly hidden what to actually do to switch to
the non-deprecated way (implement a certain delegate method).
Session 120 from WWDC 2011 has some notes on this. Apple's official
site no longer seems to have that, but it's e.g. here:
https://docs.huihoo.com/apple/wwdc/2011/session_120__view_based_nstableview.pdf
Just setting headerView to nil removes the header, but also has
the effect of no longer drawing the outline view with a sidebar
background ¯\_(ツ)_/¯.
But also setting drawsBackground to NO on the scroll view restores
the sidebar look, so do that too.
With this, it is no longer necessar to explicitly set style.
The default NSTableViewStyleAutomatic now seems to resolve to
NSTableViewStyleSourceList, so stop explicitly setting it.
(This part has no behavior change.)
Clicking an item in the outline now opens that page.
This requires giving the outline view a delegate, which for some
reason also has th effect of indenting expandable items ¯\_(ツ)_/¯
The vertical alignment of text still looks off, though.
The outline has drawing artifacts, but it is somewhat functional:
You can click on disclosure triangles to open outline items, and
if the outline doesn't fit in the sidebar, it's scrollable.
The outline view has the correct sidebar look: gray with a slightly
transparent glass effect.
Clicking items doesn't have an effect yet.
This Just Works with NSToolbarSidebarTrackingSeparatorItemIdentifier,
as long as your window is has NSWindowStyleMaskFullSizeContentView
in its style mask. If it doesn't, things behave pretty weirdly and
at least in the docs I looked at, this requirement wasn't documented
at all :/
Anyways, switch MacPDFView to use safeAreaRect instead of bounds
now that we use NSWindowStyleMaskFullSizeContentView so that we
don't draw parts of the PDF under the title bar.
Also be careful to invalidate the PDF view if safeAreaRect changes,
so that the page is redrawn when toolbar visibility gets toggled.
- MacPDFWindowController is now the xib file's owner
- _pdfView moves over
- MacPDFWindowController is now the MacPDFViewDelegate and responsible
for updating the window's title
- Due to MacPDFWindowController now being the xib file's owner,
windowControllerDidLoadNib: is no longer called automatically,
so call a custom windowIsReady method manually instead
No behavior change.
I'd like to add a sidebar, and NSSplitViewItem apparently isn't
accessibly in .xib files without contortions. So I want to move
to creating the window in code, and this is a step towards that.
No behavior change.
These functions all have a very common case that can be dealt with a
very simple inline check, often avoiding the need to call an out-of-line
function. This patch moves the common case to inline functions in a new
ValueInlines.h header (necessary due to header dependency issues..)
8% speed-up on the entire Kraken benchmark :^)
For example, the locale "fr-FR" will have the preferred hour cycle list
of "H hB", meaning h23 and h12-with-day-periods. Whether date-times are
actually formatted with day-periods is up to the user, but we need to
parse the hour cycle as h12 to know that the FR region supports h12.
This bug was revealed by LibJS no longer blindly falling back to h12 (if
the `hour12` option is true) or h24 (if the `hour12` option is false).
We currently only return primary time zones, i.e. time zones that are
not a Link. LibJS will require knowledge of Link entries, and whether
each entry is or is not a Link.
This function must return true if the object may intercept and customize
access to indexed properties (properties where the property name is a
non-negative integer.)
This will be used to implement fast path optimizations for array-like
accesses in subsequent commits.
Which pretty much needs to be done together due to the amount of places
where they are compared together.
This also involves porting over StackOfOpenElements over to FlyString
from DeprecatedFly string to prevent a gazillion calls to
`.to_deprecated_fly_string` calls in HTMLParser.
This will effectively allow us to use C++ code as an input for the
compiler. This would be useful for testing, since otherwise we would
have had to specify tests as a spec-like XML, which is not exactly the
most developer-friendly experience.
The bots complain that `forward()` could be either from libc++'s
include/c++/v1/__utility/forward.h or from AK/StdLibExtras.h.
I don't see this locally, but Ladybird also defined AK_DONT_REPLACE_STD,
so let's see if this does the trick.
Use `Meta/serenity.sh build lagom MacPDF` to build, and either of
`open Build/lagom/bin/MacPDF.app` or
`Build/lagom/bin/MacPDF.app/Contents/MacOS/MacPDF` to run.
Xcode used to insert a bunch of things to Info.plist. Now it can
no longer do that, so manually put them there
1. main.m is now main.mm
2. MainMenu.xib is now no longer in a Base.lproj subfolder
3. Remove SerenityPDF.entitlements since it won't be used in our CMake
build
xib changes:
* Add a "Go" toplevel submenu
* Put a "Go to Page..." menu item in it
* Add showGoToPageDialog: to first responder
* Bind action of new menu item to that
The dialog is just a janky NSAlert for now.
This is a bit janky for several reasons:
* `initialize` is now no longer called on a bg thread
* sheet UI is janky both visually and from an implementation PoV
But hey, it works for now.
This works great when quitting and reopening the app,
but when closing a window and the reopening from Recent Files,
the current page isn't restored. In Preview.app, it is.